Description
Line number selection relies on AVA parsing the test file. This does not work when you use a require hook (such as ts-node/register
). That's OK. However we do want it to work with our Babel and TypeScript providers.
Ultimately, we need start and end lines & columns for each call expression in the test file. First we need to initialize the providers earlier:
Lines 45 to 52 in 1222ce9
See here:
Lines 140 to 159 in 1222ce9
Then, depending on the extension of the test file, we need to get the provider to give us the call locations. For normal JS files you can find that logic here:
ava/lib/worker/line-numbers.js
Lines 1 to 28 in 1222ce9
For @ava/babel
we need to parse the test file using Babel, with all the configured plugins active and whatnot.
For @ava/typescript
, hopefully we can use typescript
itself as a parser?