Skip to content
This repository has been archived by the owner on Jul 21, 2020. It is now read-only.

Should test failure line numbers be accurate? #8

Open
jack-guy opened this issue Jan 28, 2018 · 3 comments
Open

Should test failure line numbers be accurate? #8

jack-guy opened this issue Jan 28, 2018 · 3 comments

Comments

@jack-guy
Copy link

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?

@andywer
Copy link
Owner

andywer commented Jan 29, 2018

Thanks, @Harangue 😊

That seems rather strange. Works on my machine™ (in multiple projects).
Is it in the same project as the nyc coverage issue? Maybe some of that configuration breaks it.

@jack-guy
Copy link
Author

Unfortunately it occurs with and without nyc, @andywer. Can I see your tsconfig.json? I also wonder if it could be related to my using Observable-based tests.

@andywer
Copy link
Owner

andywer commented Mar 2, 2018

Sorry for not answering in time! Just been so busy. Unfortunately I just quickly put something together in /tmp and I don't have it anymore 😕

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants