Skip to content

Using Istanbul for instrumentation (instead of V8) #2777

Open
@shirblc

Description

@shirblc

Hi!

I've recently moved my project from Karma to web-test-runner. I'm having trouble with coverage reports (wildly inaccurate reports are produced), though, so I decided to try the solution in #1715. However, that specific solution doesn't seem to work for my use case (TypeScript with decorators), and the one in the docs doesn't seem to produce anything different.

I've experimented a little bit and discovered that seeing nativeInstrumentation to false has no impact - web-test-runner seems to be using native instrumentation regardless of whether or not it's set to true (the first commit shows how it runs coverage regardless of the setting; the second commit shows the plugin having zero impact). Trying the code in the docs with another browser (both webkit and Firefox) produces no code coverage, which shows it's not being run at all (makes sense considering the above). Is there something I'm missing about how to use web-test-runner with custom instrumentation, or is there something broken?

This repo shows a very basic reproduction of both of those issues (just run npm install and npm run test). I've verified that the Istanbul plugin is being called using some logging, but for some reason no coverage report is being outputted, which seems like a web-test-runner issue. I'd be happy to do some more digging and see if I can find where it's going wrong, but if everything's behaving as intended and I misunderstood or the code in the docs is just outdated, it'd be great to hear.

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions