andywer/ava-ts

Should test failure line numbers be accurate?

開放

#8 建立於 2018年1月28日

 (3 則留言) (1 個反應) (0 位負責人)JavaScript (10 個分叉)github user discovery
help wantedquestion

倉庫指標

星標
 (115 顆星)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

Thanks so much for creating ava-ts - it's been really helpful in my projects. I've noticed, however, that wherever ava would normally output line numbers where a test failed, I get completely unrelated code:

  2 tests failed

  rooms.ts › validates room sizes

  /mnt/c/Users/Jack/git/sl-tethers/src/rooms.ts:79

   78:   };
   79:   rules: {         
   80:     rounds: number;

  Rejected promise returned by test. Reason:

  Error (BadRequest) {
    status: 400,
    message: 'You need to pick a room size.',
  }

As you can see from the example, I'm throwing an error within a function, but the highlighted output actually points to a unrelated interface declaration.

Is this a known problem? Do sourcemaps work with ava-ts?

貢獻者指南