nodejs-testing icon indicating copy to clipboard operation
nodejs-testing copied to clipboard

Test coverage, typescript and tsx

Open coderhammer opened this issue 1 month ago • 2 comments

Hey, I'm trying the new code coverage feature, first of all, thank you for the work.

It doesn't work for me, I don't know if I'm missing some configuration. Currently using this configuration:

{
  "nodejs-testing.extensions": [
    {
      "extensions": ["mjs", "cjs", "js"],
      "parameters": []
    },
    {
      "extensions": ["mts", "cts", "ts"],
      "parameters": ["--import", "tsx"]
    }
  ]
}

Everything works well except test coverage, I only have this that appears:

Screenshot 2024-05-12 at 19 17 48

And everthing shows up as 100%:

Screenshot 2024-05-12 at 19 18 43

So it looks like something does not work. When I run the following command by hand:

node --test --enable-source-maps --experimental-test-coverage --import tsx $(find src -name '*.test.ts')

I obtain:

Screenshot 2024-05-12 at 19 19 47

So the node test runner seems to recognise my files.

Are you aware of such a thing? Can I help you with identifying the root cause?

Thank you for your time and have a nice day

coderhammer avatar May 12 '24 17:05 coderhammer