Skip to content

Commit

Permalink
Create separate cypress env (#23)
Browse files Browse the repository at this point in the history
Fixes GitHub Actions problems
  • Loading branch information
lyncasterc authored Mar 14, 2024
1 parent 6ac2cd1 commit 50d5f25
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"start": "cross-env NODE_ENV=production node src/index.ts",
"dev": "cross-env NODE_ENV=development nodemon --files src/index.ts",
"start:test": "cross-env NODE_ENV=test ts-node --files src/index.ts",
"start:cypress-test": "cross-env NODE_ENV=cypress ts-node --files src/index.ts",
"start:dev": "cross-env NODE_ENV=development ts-node --files src/index.ts",
"docker:mongo": "docker-compose -f docker-compose.dev.yml up -d",
"lint": "eslint .",
Expand Down
2 changes: 1 addition & 1 deletion backend/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const app = express();

if (NODE_ENV === 'development') {
mongodbConnect(config.DEV_MONGODB_URI!);
} else if (NODE_ENV === 'test') {
} else if (NODE_ENV === 'cypress') {
(async () => {
await testMongodb.connect();
})();
Expand Down
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"test": "react-scripts test",
"eject": "react-scripts eject",
"server:dev": "cd ../backend && npm run start:dev",
"server:test": "cd ../backend && npm run start:test",
"server:test": "cd ../backend && npm run start:cypress-test",
"docker:mongo": "cd ../backend && npm run docker:mongo",
"start:dev": "concurrently \"npm run docker:mongo\" \"npm run server:dev\" \"npm start\"",
"cypress:open": "cypress open",
Expand Down

0 comments on commit 50d5f25

Please sign in to comment.