Tests are failing with SDK 27
See original GitHub issueTests are failing with sdk 27 even in the example project.
Environment
Packages: (wanted => installed)
expo: ^27.0.1 => 27.0.1
react: 16.3.1 => 16.3.1
react-native: https://github.com/expo/react-native/archive/sdk-27.0.0.tar.gz => 0.55.2
Steps to Reproduce
(Write your steps here:)
exp init test
- Chose tab layout
cd test
npm install
npm test
Expected Behavior
Test should run fine.
Actual Behavior
Actual test output:
PASS components/__tests__/StyledText-test.js
RUNS __tests__/App-test.js
Test Suites: 1 passed, 1 of 2 total
Tests: 1 passed, 1 total
Snapshots: 1 passed, 1 total
Time: 3s/app/test/node_modules/react-native/Libraries/Interaction/TaskQueue.js:1
({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,global,jest){'use strict';var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor;};}();function _classCallCheck(instance,Constructor){if(!(instance instanceof Construc
TypeError: TaskQueue: Error with task : Cannot read property 'Object.<anonymous>' of null
at Runtime._execModule (/app/test/node_modules/jest-runtime/build/index.js:447:72)
at Runtime.requireModule (/app/test/node_modules/jest-runtime/build/index.js:265:14)
at Runtime.requireModuleOrMock (/app/test/node_modules/jest-runtime/build/index.js:337:19)
at parseErrorStack (/app/test/node_modules/react-native/Libraries/Core/Devtools/parseErrorStack.js:1:179)
at updateWarningMap (/app/test/node_modules/react-native/Libraries/ReactNative/YellowBox.js:1:3858)
at BufferedConsole.Object.<anonymous>.console.warn (/app/test/node_modules/react-native/Libraries/ReactNative/YellowBox.js:1:2598)
at Component.measureInWindow (/app/test/node_modules/react-native/jest/setup.js:1:2534)
at SafeView._this._onLayout (/app/test/node_modules/react-native
RUNS __tests__/App-test.js
Test Suites: 1 passed, 1 of 2 total
Tests: 1 passed, 1 total
Snapshots: 1 passed, 1 total
Time: 5s
Not sure if it’s a expo related bug. After upgrading my project from sdk 26 to 27 it appears.
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
Robolectric does not support API level 27 - Stack Overflow
I am using 3.3.2 Version of Roboelectric for Testing in my Android application. ... Is roboelectirc is not supported with SDK version 27...
Read more >How to Fix “Failed to install the following Android SDK ...
Step 1: In Android Studio go to Tools > SDK Manager. Step 2: Go to the SDK Tools tab as shown in the...
Read more >SDK Build Tools release notes - Android Developers
Android SDK Build-Tools is a component of the Android SDK required for building Android apps. It's installed in the <sdk>/build-tools/ directory.
Read more >Setting Up Android SDK and NDK for Unreal
If you do not use the default SDK path, it is possible for SetupAndroid.bat to fail during a later step, as it will...
Read more >Get started testing for Android with Firebase Test Lab - Google
Any uncaught exception will cause a test failure. ... Test Lab devices usually run on the latest version of the Google Play services...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The tests are failing (or running forever) when a console warn message occurs. Which is the case in the example project:
This will trigger a call to
parseErrorStack()
a react-native devtools library method. Inside this method a other module is required. The require call is done after torn down of jest which will lead to the unexpected behavior of jest.My workaround for now is to add
require('stacktrace-parser');
to my ownsetupJest.js
file:package.json:
setupJest.js:
I will investigate further how to get a serious fix for that.
The original repro commands with the current version of Expo (SDK 35) work now: