avajs/ava

Line number parser doesn't utilize @ava/typescript's compilation output

Open

#3064 opened on Jul 10, 2022

View on GitHub
 (5 comments) (0 reactions) (0 assignees)JavaScript (20,600 stars) (1,408 forks)batch import
bughelp wantedscope:globbingscope:internalsscope:typescript

Description

Line number selection doesn't use the @ava/typescript provider to resolve the compiled JS file. This means it's parsing the actual TypeScript file which is not supported:

https://github.com/avajs/ava/blob/ac0d75d05d28e511b1b3654b09d11d602e360179/lib/worker/base.js#L42-L51

We'd need to amend the worker interface to make the file resolver available:

https://github.com/avajs/typescript/blob/34da7bf008bd94e4844562ed86f5446faae6c087/index.js#L152-L168

This requires a new protocol identifier, and the file resolver should only be called if available to retain compatibility with the current @ava/typescript version. I can explain more when we get to this point:

https://github.com/avajs/ava/blob/ac0d75d05d28e511b1b3654b09d11d602e360179/lib/provider-manager.js#L12-L14

We can then install the providers earlier:

https://github.com/avajs/ava/blob/ac0d75d05d28e511b1b3654b09d11d602e360179/lib/worker/base.js#L123-L132

Contributor guide