Open mvasin opened 3 years ago
Did you find any solution for this?
@bcamarneiro unfortunately not.
Hey, I had the same problem and I solved it. I'm not sure what's the root issue, but in my package.json
there was:
"husky": {
"hooks": {
"pre-push": "yarn run test:cy -- --env configFile=local"
}
},
and after removing -- --env configFile=local
it started working.
Full package.json content:
{
"name": "my-app",
"version": "0.1.0",
"private": true,
"dependencies": {},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"cy:run": "cypress run",
"test:cy": "start-server-and-test start http://localhost:3000 cy:run"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
">0.2%",
"not dead",
"not op_mini all"
]
},
"husky": {
"hooks": {
"pre-push": "yarn run test:cy"
}
},
"devDependencies": {
"@types/fs-extra": "^9.0.6",
"start-server-and-test": "^1.11.7"
}
}
hopefully I helped
Is this a bug report or a feature request?
If this is a bug report, please provide as much info as possible
I test a
create-react-app
-based app.With this code in
husky.config.js
I expect to run Cypress tests on
git push
.Error: server closed unexpectedly at ChildProcess.onClose (/Users/foo/project/node_modules/start-server-and-test/src/index.js:69:14) at ChildProcess.emit (events.js:314:20) at maybeClose (internal/child_process.js:1047:16) at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5) error Command failed with exit code 1.