-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
Automocking disabled by default but Jest warns about unmocking a manual mock #1552
Comments
In Jest 15, the option automock is set to
So, if I understood correctly, you can safely remove that line |
No. When I remove
Which means that |
Can you explain what you are trying to do a bit better? The example code above, is that from your manual mock? If so, you shouldn't call |
No, it did not help. Look: // jest.unmock('react-relay');
import React from 'react'; // eslint-disable-line import/imports-first
const Relay = require.requireActual('react-relay'); // eslint-disable-line import/imports-first
import TestUtils from 'react-addons-test-utils'; // eslint-disable-line import/imports-first
Relay.injectNetworkLayer(
new Relay.DefaultNetworkLayer('http://localhost:10000/q')
);
... The output is
Here's what I am trying to achieve.
const Relay = require.requireActual('react-relay');
module.exports = {
QL: Relay.QL,
Mutation: Relay.Mutation,
Route: Relay.Route,
createContainer: (component) => component,
}; So this way my components which have
-- The first one going with Does it make sense? Sorry, but I'm going to repeat. Going with the |
Can you create a repo with this so I can take a look? I'm not really sure why this is happening and can't give hints without the full setup. |
@cpojer yes, sure. Here it is https://github.com/GrigoryPtashko/jest-relay-integration-test. Thanks. |
Ah, this might be a real issue with Jest 15. Can you try, as a workaround, to call:
and let me know if that works? |
No, that did not help.
|
Thanks for the repro. I'd recommend for now to call |
Yes, this ways it works. |
@cpojer What would be the fix for this bug? I mean, should we start adding manual |
Yeah the workaround I mentioned above is still recommended until we change how this works in Jest. |
Having this issue as well. Any plans for a fix? |
Will be fixed in the next release. #2022 |
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. |
After upgrading to
Jest
15 with all config options set to defaults it gives warning that I'm unmocking a manual mock.I've got a manual mock for
Relay
in___mocks__
and in the integration tests I want to use the realRelay
. So I go with:And get the warning which in my view must not be:
Here's my config
Am I misunderstanding something?
The text was updated successfully, but these errors were encountered: