yazoox
V2EX  ›  编程

请问一下,一般 code coverage 报告里面,标记黄色的是什么含义?

  •  
  •   yazoox · Aug 3, 2020 · 2614 views
    This topic created in 2116 days ago, the information mentioned may be changed or developed.

    如图,

    绿色不说了,就是测试跑到了。有的前面还有 1x,2x,应该是跑到多少次。

    红色也清楚,就是没有测试到的代码。

    还有一种黄色的,啥意思?一般都是在“条件判断”处。

    是某个条件没有达到?部分满足?还是说,虽然该语句执行到了,但条件失败,所以后面{}里面的代码没有执行到?

    ......

    Supplement 1  ·  Aug 3, 2020

    居然忘记上传图了。

    javascript/typescript

    Jest写的unit test

    Screen Shot 2020-08-03 at 1.54.47 PM.png

    2 replies    2020-08-03 14:43:54 +08:00
    mmrx
        1
    mmrx  
       Aug 3, 2020
    用的什么框架,找文档呀
    yazoox
        2
    yazoox  
    OP
       Aug 3, 2020
    @mmrx
    javascript/typescript

    Jest 写的 unit test
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5768 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 45ms · UTC 03:23 · PVG 11:23 · LAX 20:23 · JFK 23:23
    ♥ Do have faith in what you're doing.