2
我的笑話當在笑話中平行運行時,測試失敗。當在笑話中並行運行時,測試進程終止 - 「工作進程意外退出!」
當我嘗試運行
jest
從我的項目的根我得到以下錯誤和測試過程結束。
「工作進程意外退出!」
我使用笑話19.0.2和節點6.9.4。我也嘗試了節點7.7.2和開玩笑19.0的其他組合,也沒有工作。
需要注意的是,當我跑我的測試順序使用
jest --runInBand
我的測試中正常工作。雖然它們不是平行運行,但速度較慢,這並不理想。
我的測試爲每個新測試啓動相同的服務器,因此可能並行運行意味着多個測試正試圖在已經運行的端口上啓動服務器。
這裏是我的package.json:
{
"name": "app",
"version": "0.1.0",
"private": true,
"devDependencies": {
"autoprefixer": "6.5.1",
"babel-core": "6.17.0",
"babel-eslint": "7.1.1",
"babel-jest": "17.0.2",
"babel-loader": "6.2.7",
"babel-preset-react-app": "^2.0.1",
"case-sensitive-paths-webpack-plugin": "1.1.4",
"chai": "^3.5.0",
"chai-as-promised": "^6.0.0",
"chalk": "1.1.3",
"connect-history-api-fallback": "1.3.0",
"cross-spawn": "4.0.2",
"css-loader": "0.26.0",
"detect-port": "1.0.1",
"dotenv": "2.0.0",
"eslint": "3.8.1",
"eslint-config-react-app": "^0.5.0",
"eslint-loader": "1.6.0",
"eslint-plugin-flowtype": "2.21.0",
"eslint-plugin-import": "2.0.1",
"eslint-plugin-jsx-a11y": "2.2.3",
"eslint-plugin-react": "6.4.1",
"extract-text-webpack-plugin": "1.0.1",
"file-loader": "0.9.0",
"filesize": "3.3.0",
"fs-extra": "0.30.0",
"gzip-size": "3.0.0",
"html-webpack-plugin": "2.24.0",
"http-proxy-middleware": "0.17.2",
"jest": "^19.0.2",
"jest-css-modules": "^1.1.0",
"json-loader": "0.5.4",
"object-assign": "4.1.0",
"path-exists": "2.1.0",
"postcss-loader": "1.0.0",
"promise": "7.1.1",
"react-dev-utils": "^0.4.2",
"recursive-readdir": "2.1.0",
"redux-mock-store": "^1.2.2",
"sinon": "^1.17.7",
"strip-ansi": "3.0.1",
"style-loader": "0.13.1",
"supertest": "^3.0.0",
"url-loader": "0.5.7",
"webpack": "1.14.0",
"webpack-dev-server": "1.16.2",
"webpack-manifest-plugin": "1.1.0",
"whatwg-fetch": "1.0.0"
},
"dependencies": {
"axios": "^0.15.3",
"bcrypt-nodejs": "0.0.3",
"body-parser": "^1.16.0",
"cors": "^2.8.1",
"eventemitter2": "^3.0.1",
"express": "^4.14.0",
"jwt-simple": "^0.5.1",
"mocha": "^3.2.0",
"mongoose": "^4.7.8",
"morgan": "^1.7.0",
"nodemon": "^1.11.0",
"passport": "^0.3.2",
"passport-jwt": "^2.2.1",
"passport-local": "^1.0.0",
"react": "^15.4.2",
"react-dom": "^15.4.2",
"react-redux": "^5.0.2",
"react-router": "^3.0.2",
"redux": "^3.6.0",
"redux-devtools-extension": "^2.13.0",
"redux-form": "^5.3.3",
"redux-socket.io": "^1.3.1",
"redux-thunk": "^2.2.0",
"socket.io-client": "^1.7.3",
"socketio-auth": "^0.1.0"
},
"scripts": {
"start": "node scripts/start.js",
"build": "node scripts/build.js",
"test": "jest --runInBand"
},
"jest": {
"collectCoverageFrom": [
"src/**/*.{js,jsx}"
],
"setupFiles": [
"<rootDir>/config/polyfills.js"
],
"testPathIgnorePatterns": [
"<rootDir>[/\\\\](build|docs|node_modules)[/\\\\]"
],
"testEnvironment": "jest-environment-jsdom",
"testURL": "http://localhost",
"transform": {
"^.+\\.(js|jsx)$": "<rootDir>/node_modules/babel-jest",
"^.+\\.css$": "<rootDir>/node_modules/jest-css-modules"
},
"transformIgnorePatterns": [
"[/\\\\]node_modules[/\\\\].+\\.(js|jsx)$"
],
"verbose": true,
"moduleNameMapper": {
"^react-native$": "react-native-web"
}
},
"babel": {
"presets": [
"react-app"
]
},
"eslintConfig": {
"extends": "react-app"
}
}