Comments (6)
+1
from react-native-mock.
Looking at that stack trace, it probably is a react-native-mock
bug. However it's very difficult to tell what the issue is with just that stack trace. Can you try and reproduce it more clearly with an example, or provide a stack trace
from react-native-mock.
I'll try to reproduce in the meantime here is some more info. The above is what I keep getting when I try to run jest, so currently can run any tests.
What led me to use react-native-mock
was the fact that I couldn't mock NativeEventEmitter
which we are using.
dependencies
"dependencies": {
"babel-plugin-transform-decorators-legacy": "1.3.4",
"bugsnag-react-native": "2.2.0",
"class-autobind": "^0.1.4",
"color": "0.11.3",
"lodash": "4.15.0",
"moment": "2.17.1",
"react": "15.4.2",
"react-native": "0.42.3",
"react-native-calendar": "0.10.0",
"react-native-extended-stylesheet": "0.3.0",
"react-native-fs": "2.1.0-rc.1",
"react-native-keyboard-aware-scroll-view": "0.2.3",
"react-native-material-kit": "0.4.1",
"react-native-sensitive-info": "3.0.2",
"react-native-snap-carousel": "1.2.0",
"react-native-svg": "5.1.5",
"react-native-vector-icons": "2.1.0",
"react-redux": "4.4.5",
"redux": "3.6.0",
"redux-async-action": "0.0.4",
"redux-thunk": "2.1.0",
"victory-native": "0.7.0"
},
"devDependencies": {
"babel-eslint": "6.1.2",
"babel-jest": "20.0.3",
"enzyme": "2.8.2",
"enzyme-to-json": "1.5.1",
"eslint": "3.7.1",
"eslint-config-airbnb": "10.0.1",
"eslint-plugin-import": "1.16.0",
"eslint-plugin-jsx-a11y": "2.2.3",
"eslint-plugin-react": "6.4.1",
"gradle-to-js": "0.2.5",
"husky": "0.11.9",
"jest": "20.0.4",
"localenv": "0.2.2",
"react-addons-test-utils": "15.4.2",
"react-dom": "15.4.4",
"react-test-renderer": "15.4.2",
"redux-mock-store": "1.2.3",
"request": "2.81.0",
"react-native-mock": "0.3.1"
}
Jest config
"jest": {
"preset": "react-native",
"verbose": true,
"setupFiles": ["./jestsetup.js"],
"snapshotSerializers": [
"enzyme-to-json/serializer"
],
"transformIgnorePatterns": [
"node_modules/(?!react-native|bugsnag-react-native)/"
]
},
jestSetup.js
require('react-native-mock/mock');
jest.mock('NativeModules', () => ({
Environment: {
BUGSNAG_API_KEY: 'ApiKey',
},
}));
from react-native-mock.
Hmm, interesting. I'd never considered people wanting to use react-native-mock
with jest
, but i guess it should work. But yes please try and narrow down exactly why it happens. It's possible it's some conflicting between react-native-mock
and jest
's builtin mock
from react-native-mock.
@miguelc1221 I am also experiencing the same issue. Have you found a solution to this?
from react-native-mock.
I get this because KeyboardManager
is not included in the mocked native modules
from react-native-mock.
Related Issues (20)
- React v15.5.0 Deprecation Warnings HOT 3
- Need a way to reset _animationFrame count HOT 2
- Mock for i18nManager HOT 3
- Missing support for percentage widths HOT 1
- Does it support mock fetch? HOT 3
- TypeError: Cannot read property 'number' of undefined HOT 23
- Cannot find module 'react/lib/ReactComponentTreeHook' from 'ReactDebugTool.js' HOT 35
- not able to install from npm HOT 6
- Plans to support FlatList HOT 1
- Should `babel-preset-airbnb` be in `dependencies`? HOT 1
- Warning: ReactTestUtils has been moved to react-dom/test-utils HOT 1
- Issue using via package manager since build is required HOT 6
- View.PropTypes is depricated but still used here. HOT 2
- emitting event from native ios working example
- Animated Delay is not exported HOT 1
- Animated is not fully mocked
- No wiki page now HOT 1
- Cannot find module 'ReactPerf' from 'react-native.js'
- Maintainers wanted HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-mock.