andywer/ava-ts

Should test failure line numbers be accurate?

Aperta

#8 aperta il 28 gen 2018

 (3 commenti) (1 reazione) (0 assegnatari)JavaScript (10 fork)github user discovery
help wantedquestion

Metriche repository

Star
 (115 stelle)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

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?

Guida contributor