-
Notifications
You must be signed in to change notification settings - Fork 24.8k
Closed
Labels
BugResolution: LockedThis issue was locked by the bot.This issue was locked by the bot.🔩Test InfrastructureTest infrastructure and continuous integration.Test infrastructure and continuous integration.
Description
- Review the documentation: https://facebook.github.io/react-native
- Search for existing issues: https://github.com/facebook/react-native/issues
- Use the latest React Native release: https://github.com/facebook/react-native/releases
Environment
React Native Environment Info:
System:
OS: macOS 10.14.1
CPU: (4) x64 Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz
Memory: 260.95 MB / 8.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 8.11.3 - /usr/local/bin/node
Yarn: 1.9.4 - /usr/local/bin/yarn
npm: 5.6.0 - /usr/local/bin/npm
Watchman: 4.7.0 - /usr/local/bin/watchman
npmPackages:
react: 16.6.1 => 16.6.1
react-native: 0.57.7 => 0.57.7
npmGlobalPackages:
react-native-cli: 2.0.1
react-native-git-upgrade: 0.2.7
Description
Dependency modules not mocks by jest.mock
Reproducible Demo
//jest config
{
"preset": "react-native",
"transform": {
"^.+\\.(js)$": "<rootDir>/node_modules/react-native/jest/preprocessor.js"
}
}
// module1.js
export default class Module1{
testFunction(){
return 2
}
}
// module2.js
import Module1 from './module1';
const module1 = new Module1();
export default module1.testFunction();
// test.js
jest.mock('./module1',()=>{ });
import module2 from './module2';
describe('test',()=>{
it('description', ()=>{
expect(module2).toBe(2)
})
});
Expected Behavior
Test failed
Actual Behavior
Test passed
tkirda and rvaitkus23
Metadata
Metadata
Assignees
Labels
BugResolution: LockedThis issue was locked by the bot.This issue was locked by the bot.🔩Test InfrastructureTest infrastructure and continuous integration.Test infrastructure and continuous integration.