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
'use strict';
describe('using config.rootDir', function() {
it('has problems when mocking node_modules', function() {
// lodash and kew have been installed with npm
jest.setMock('lodash', 'lodash');
jest.setMock('kew', 'kew');
console.log(require('lodash'));
console.log(require('kew'));
});
it('works when mocking my own modules', function() {
// ../foo and ../bar are my own modules
jest.setMock('../foo', 'foo');
jest.setMock('../bar', 'bar');
console.log(require('../foo'));
console.log(require('../bar'));
});
});
this yields:
Using Jest CLI v0.1.15
Found 1 matching tests...
PASS __tests__/baz-test.js (0.032s)
kew
kew
foo
bar
1 tests passed (1 total)
Run time: 0.86s
i was expecting:
Using Jest CLI v0.1.15
Found 1 matching tests...
PASS __tests__/baz-test.js (0.032s)
lodash
kew
foo
bar
1 tests passed (1 total)
Run time: 0.86s
The text was updated successfully, but these errors were encountered:
Thank you for reporting this issue and appreciate your patience. We've notified the core team for an update on this issue. We're looking for a response within the next 30 days or the issue may be closed.
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.
There seems to be an issue when using config.rootDir when mocking node_module(s).
folder structure
root/package.json
root/client/app/tests/test.js:
this yields:
i was expecting:
The text was updated successfully, but these errors were encountered: