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
Not really sure what's going on here. I have also set them to hard-coded values rather than environmental variables, but that doesn't seem to make any difference.
Any help most appreciated!
Thanks
Gareth
The text was updated successfully, but these errors were encountered:
What test runner are you using? I found you can't override const with Rewire in Jest. Change your constants to let and see if that works. Also see #144 and jestjs/jest#6803
Trying to write a unit test for an imported function using Chai and rewire and am struggling to be able to override some const set in that file.
So here's my test file.
Importing the file, and then setting some new values, then accessing the function I need to test via rewire get as it's not exported.
Problem is the const values I'm trying to change don't get changed when I call the function.
Here is them being declared in the global scope of the imported file, and the function I am calling which uses them:
Not really sure what's going on here. I have also set them to hard-coded values rather than environmental variables, but that doesn't seem to make any difference.
Any help most appreciated!
Thanks
Gareth
The text was updated successfully, but these errors were encountered: