andywer/ava-ts

Should test failure line numbers be accurate?

Offen

#8 geöffnet am 28.01.2018

 (3 Kommentare) (1 Reaktion) (0 zugewiesene Personen)JavaScript (10 Forks)github user discovery
help wantedquestion

Repository-Metriken

Stars
 (115 Sterne)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

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?

Contributor Guide