Skip to content

Commit 50d5f25

Browse files
authored
Create separate cypress env (#23)
Fixes GitHub Actions problems
1 parent 6ac2cd1 commit 50d5f25

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

backend/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"start": "cross-env NODE_ENV=production node src/index.ts",
1111
"dev": "cross-env NODE_ENV=development nodemon --files src/index.ts",
1212
"start:test": "cross-env NODE_ENV=test ts-node --files src/index.ts",
13+
"start:cypress-test": "cross-env NODE_ENV=cypress ts-node --files src/index.ts",
1314
"start:dev": "cross-env NODE_ENV=development ts-node --files src/index.ts",
1415
"docker:mongo": "docker-compose -f docker-compose.dev.yml up -d",
1516
"lint": "eslint .",

backend/src/app.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const app = express();
1414

1515
if (NODE_ENV === 'development') {
1616
mongodbConnect(config.DEV_MONGODB_URI!);
17-
} else if (NODE_ENV === 'test') {
17+
} else if (NODE_ENV === 'cypress') {
1818
(async () => {
1919
await testMongodb.connect();
2020
})();

frontend/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"test": "react-scripts test",
3636
"eject": "react-scripts eject",
3737
"server:dev": "cd ../backend && npm run start:dev",
38-
"server:test": "cd ../backend && npm run start:test",
38+
"server:test": "cd ../backend && npm run start:cypress-test",
3939
"docker:mongo": "cd ../backend && npm run docker:mongo",
4040
"start:dev": "concurrently \"npm run docker:mongo\" \"npm run server:dev\" \"npm start\"",
4141
"cypress:open": "cypress open",

0 commit comments

Comments
 (0)