Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node test coverage fails with rewire 7.0.0 #213

Open
cm45t3r opened this issue Apr 14, 2024 · 0 comments
Open

Node test coverage fails with rewire 7.0.0 #213

cm45t3r opened this issue Apr 14, 2024 · 0 comments

Comments

@cm45t3r
Copy link

cm45t3r commented Apr 14, 2024

Hi,

Node test coverage fails when using rewire 7.0.0. Tests pass but coverage breaks:

Line of code that fails

// test/ok.js
const myFunction = rewire('../src/my-module').__get__('myFunction');

Also tried

let myFunction;

before(() => {
  myFunction = rewire('../src/my-module').__get__('myFunction');
});

Execution

node --test --experimental-test-coverage

Results

✔ test/ok.js
Warning: Could not report code coverage. TypeError: Cannot read properties of undefined (reading 'line')
ℹ tests 20
ℹ suites 7
ℹ pass 20
ℹ fail 0
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 5970.011996

Versions

Node: 21.7.3
Rewire: 7.0.0

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

No branches or pull requests

1 participant