Test suite failed to run- Call retries were exceeded
See original GitHub issueEnvironment
-
node -v
: v12.1.0 -
npm -v
: 6.9.0 -
npm ls jest
ornpm ls react-scripts
(if you haven’t ejected): No -
your vscode-jest settings if customized:
- jest.pathToJest? No
- jest.pathToConfig? package.json
- anything else that you think might be relevant? No
-
Operating system: MACOS MOJAVE - 10.14.5
Prerequisite
- are you able to run jest test from command line? Yes
- how do you run your tests from command line? (for example:
npm run test
ornode_modules/.bin/jest
) npm test – -u
Steps to Reproduce
when I run npm test – -u the coverage is really bad and the test Fail. I don’t know why this error is happenig…
CLASS
import React, { Component } from 'react';
import {
View,
Text,
TouchableOpacity,
Image,
Modal,
} from 'react-native';
import PropTypes from 'prop-types';
import { SafeAreaView } from 'react-navigation';
import styles from './Style';
const bag = require('../../assets/images/icons/addedBag/added_bag.png');
class AddedToBag extends Component {
static propTypes = {
hideModal: PropTypes.func,
modalVisible: PropTypes.bool,
image: PropTypes.string.isRequired,
productName: PropTypes.string.isRequired,
price: PropTypes.string.isRequired,
};
static defaultProps = {
hideModal: () => {},
modalVisible: false,
}
hideModalComponent = () => {
const { hideModal } = this.props;
hideModal();
}
render() {
const {
modalVisible, image, productName, price,
} = this.props;
return (
<Modal
animationType="slide"
transparent
visible={modalVisible}
>
<View style={styles.flexView} />
<SafeAreaView style={styles.view}>
<View style={styles.titleView}>
<Text style={styles.titleText}>
ADICIONADO
</Text>
</View>
<View style={styles.productView}>
<View>
<Image
style={styles.productImage}
source={{ uri: image }}
/>
</View>
<View style={styles.flexView}>
<Text
style={styles.productText}
numberOfLines={1}
ellipsizeMode="tail"
>
{productName}
</Text>
<Text style={styles.productPriceText}>
R$ 69,90
</Text>
</View>
</View>
<View style={styles.buttonView}>
<TouchableOpacity
style={styles.buttonTouchable}
onPress={this.hideModalComponent}
>
<Image
source={bag}
/>
<Text style={styles.buttonText}>
IR PARA SACOLA
</Text>
</TouchableOpacity>
</View>
</SafeAreaView>
</Modal>
);
}
}
export default AddedToBag;
TEST
import 'react-native';
import React from 'react';
import renderer from 'react-test-renderer';
import AddedToBag from '../../src/components/modalBag/AddedToBag';
describe('Test Added To Bag', () => {
function doWork() {
console.log('Back button was clicked!');
}
test('Added to bag renders correctly', () => {
const props = {
hideModal: doWork,
modalVisible: true,
image: '',
productName: 'Test Bag',
price: '500,50',
};
const addedToBag = renderer
.create(<AddedToBag {...props} />)
.toJSON();
expect(addedToBag).toMatchSnapshot();
});
});
CONSOLE
FAIL __tests__/components/AddedToBag-test.js
● Test suite failed to run
Call retries were exceeded
at ChildProcessWorker.initialize (node_modules/jest-runner/node_modules/jest-worker/build/workers/ChildProcessWorker.js:193:21)
PACKAGE.JSON
"jest": { "preset": "react-native", "transformIgnorePatterns": [ "node_modules/(?!(jest-)?react-native|react-navigation|react-navigation-redux-helpers|@react-navigation|@react-native-community|rn-sliding-up-panel|react-native-safe-area/.*)" ], "setupFiles": [ "./node_modules/react-native-gesture-handler/jestSetup.js", "./__mocks__/@react-native-community/jestSetupFile.js" ], "testMatch": [ "<rootDir>/__tests__/**/*-test.js?(x)" ], "testPathIgnorePatterns": [ "/node_modules/", "<rootDir>/ios" ], "verbose": true, "setupFilesAfterEnv": [ "<rootDir>/__tests__/setup-tests.js" ] },
Issue Analytics
- State:
- Created 4 years ago
- Comments:7
Top GitHub Comments
In one of our projects,
-i
results in segmentation fault. Node version: 13.2.0. The observation is same as mentioned here: https://github.com/facebook/jest/issues/8769#issuecomment-558670948Tests run fine with Node version 12.13.1.
any fixed on this?