-
Notifications
You must be signed in to change notification settings - Fork 27
Weird stuff (unmocking might be broken) with Node.js 8 #24
Comments
I too am finding that with node 8 the mocks are not being reset on calling stop / stopAll |
@zakgrant Node 8 or 8.5? I'm seeing a big difference between how |
@boblauer yeah I am using node 8.5 |
I've got a similar issue... but I don't think it's with my version of node. I have something going on where some of the files stop mocking and some don't? I use setup my mocks in a mock('../../lib/docusign', '../../libmocks/docusign_mock'); and then in the test for the that specific lib file, I do: before(() => {
mock.stop('../../lib/docusign');
docusign = require('../../lib/docusign');
});
after(() => {
mock('../../lib/docusign', '../../libmocks/docusign_mock');
}); With the goal of mocking with fixtures for everything apart from testing the file itself. |
Not sure if it's related or not, but I'm finding that it's not catching module |
@alexpchin I think you're right that that is unrelated. Do you mind opening a new issue, with possibly a sample project that reproduces the issue? @robertmain It does not work with native I would recommend you take a look at https://babeljs.io/repl/#?babili=false&browsers=&build=&builtIns=false&code_lz=Q&debug=false&circleciRepo=&evaluate=true&lineWrap=false&presets=es2015%2Creact%2Cstage-2&targets=&version=6.26.0 to see what your code is actually being converted to, I suspect the issue might be in the conversion itself. |
Well my code is TypeScript so, it is running through a transpiler(just not Babel). However it seems not to be working with that. |
I'm also having this issue in node 8.5 :/. Anyone have a workaround? |
@bobbyg603 I ended up using a different package( |
This is still an issue with latest version, |
Still an issue. See failing CI here: |
Still an issue for me as well... |
My reproduction code is here.
Here is a screencast of me debugging the issue. I hope you enjoy it rather than swear at me for it.
So am I using it wrong or what?
The text was updated successfully, but these errors were encountered: