You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
~~/v8.10.0/bin/node ~~/v8.10.0/lib/node_modules/npm/bin/npm-cli.js test --scripts-prepend-node-path=auto
>[email protected]test~~/jest-rewire-const-error
> mocha ./test/example.mocha.js && jest example
Show mocha works
✓ should add the numbers together
1 passing (5ms)
FAIL test/example.jest.test.js
● Test suite failed to run
TypeError: Assignment to constant variable.
at eval (eval at __set__ (example.js:72:5), <anonymous>:1:3)
at Function.__set__ (example.js:72:5)
at Object.<anonymous> (test/example.jest.test.js:6:15)
Test Suites: 1 failed, 1 total
Tests: 0 total
Snapshots: 0 total
Time: 0.905s
Ran all test suites matching /example/i.
npm ERR! Test failed. See above for more details.
Process finished with exit code 1
The text was updated successfully, but these errors were encountered:
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.
🐛 Bug Report
Rewire throws a Type Error when overriding a const variable while running Jest tests.
To Reproduce
See my repo below for a working example.
Expected behavior
I expect the Jest test to execute succesfully in the same way the Mocha tests currently do.
Link to Repo
Github Repo with bug: https://github.com/Shakakai/jest-rewire-const-error
Run
npm test
The text was updated successfully, but these errors were encountered: