-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Description
- Jest v21.0.1
- I have removed and reinstalled the node_modules folder
- I have run jest --no-cache
Node version: 7.8.0
Also used NVM to upgrade to Node v8.4.0, fresh yarn global install, deleted node modules and reinstalled, error still exists.
{
"name": "rnJestBugRepl",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"react": "16.0.0-alpha.12",
"react-native": "0.48.1"
},
"devDependencies": {
"babel-jest": "21.0.0",
"babel-preset-react-native": "3.0.2",
"jest": "21.0.1",
"react-test-renderer": "16.0.0-alpha.12"
},
"jest": {
"preset": "react-native"
}
}
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
Fresh project, RN0.48.1 fails with error running yarn test. I noticed the error appear on an existing project after upgrading to RN0.48.1 on every test.
TypeError: Cannot read property 'BLOB_URI_SCHEME' of undefined
at Object.<anonymous> (node_modules/react-native/Libraries/Blob/URL.js:21:21)
at node_modules/react-native/Libraries/Core/InitializeCore.js:174:40
at getValue (node_modules/react-native/Libraries/Utilities/defineLazyObjectProperty.js:44:10)
at ContextifyScript.Script.runInContext (vm.js:32:29)
Commenting out the blob requirement in the node_modules/react-native/Libraries/Blob/URL.js:21:21
file allows the app to continue to pass all tests. The app runs without errors with no source code modification.
I have a copy of my code here: https://github.com/rknell/rn0481JestBugReproduction
If the current behavior is a bug, please provide the steps to reproduce and either a repl.it demo through https://repl.it/languages/jest or a minimal repository on GitHub that we can yarn install
and yarn test
.
What is the expected behavior?
Tests continue to run as normal
Please provide your exact Jest configuration and mention your Jest, node, yarn/npm version and operating system.
Please see repo for config, further details below
Npm (on node 8 5.3.0)
Yarn 0.27.5