V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
wubaiqing
V2EX  ›  分享发现

[前端] 每日时报 - 2019.06.18

  •  
  •   wubaiqing · 2019-06-18 16:35:38 +08:00 · 994 次点击
    这是一个创建于 1781 天前的主题,其中的信息可能已经有所发展或是发生改变。

    2019.06.18

    [类库] html-to-jsx 是可以把 HTML 转换成 JSX 的工具库;很好理解,我们直接看它的单元测试:https://github.com/littlehaker/html-to-jsx/blob/master/test/index.js

    [类库] react-hook-form 看库的名字很好理解,是对 React Form 表单包装了一层 Hook 函数,可以用于校验等;但这次主要目的不是分享它,而是分享它另外的一个功能,叫做表单生成器;后续我们团队为了快速的做业务性开发,也会弄表单生成器,我会参考它去做:https://react-hook-form.com/builder/

    [工具] spearmint 是一个客户端的测试工具,提供了一套 GUI 界面,可以方便的渲染组件视图、测试逾期结果、添加 Mock 和测试事件:https://github.com/spearmintjs/spearmint

    [工具] Appium 是针对 APP 的测试框架,多数的测试框架也意味着可以做数据抓取,比如我想抓链家的房源、小红书的搭配信息都可以用它来做:https://github.com/appium/appium

    配图 - react-hook-form

    配图 - spearmint

    ø

    示例 - html-to-jsx

    describe('html attributes', function() {
        it('class should be repleaced with className', function() {
            assert.equal(convert('<div class="foobar"></div>'), '<div className="foobar"></div>');
        });
    
        it('for should be repleaced with htmlFor', function() {
            assert.equal(convert('<label for="foobar"></label>'), '<label htmlFor="foobar"></label>');
        });
    
        it('attributes should be camelCased', function() {
            assert.equal(convert('<input type="text" maxlength="10" minlength="0"/>'), '<input type="text" maxLength="10" minLength="0"/>');
        });
    });
    

    今日图 - PM 讲需求

    GitHub: https://github.com/wubaiqing/zaobao
    查看更多: https://wubaiqing.github.io/zaobao/2019/06/18.html

    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2353 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 12:28 · PVG 20:28 · LAX 05:28 · JFK 08:28
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.