3

使用 mocha + chai,当抛出 AssertionError 时,我看到了这个

AssertionError: expected 2 to equal 4
      + expected - actual

      -2
      +4

    at Context.<anonymous> (test/sync.coffee:116:18)

当使用 chai-as-promised 我看到这个

1) Syncing Non-bare (empty staging area) to bare should sync all files:

      AssertionError: expected 2 to equal 3
      + expected - actual

      -2
      +3

使用 chai-as-promised 时是否有一种简单的方法来获取行号?

此处的完整复制回购 https://github.com/rissem/chai-as-promised-stack-trace

npm install

npm test

4

0 回答 0