Skip to content

Commit 0c74648

Browse files
committed
adding serve for running e2e tests
1 parent d70c470 commit 0c74648

File tree

4 files changed

+280
-14
lines changed

4 files changed

+280
-14
lines changed

.circleci/config.yml

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,26 @@ workflows:
88
version: 2
99
pipeline:
1010
jobs:
11+
- install:
12+
filters:
13+
branches:
14+
only: main
1115
- run_tests:
1216
filters:
1317
branches:
1418
only: main
19+
requires:
20+
- install
1521
- cypress/run:
1622
yarn: true
1723
executor: cypress/base-14
18-
start: yarn start
19-
wait-on: 'http://localhost:3000'
24+
start: yarn serve
25+
wait-on: 'http://localhost:5000'
2026
filters:
2127
branches:
2228
only: main
29+
requires:
30+
- install
2331
- publish_github_page:
2432
filters:
2533
branches:
@@ -29,7 +37,7 @@ workflows:
2937
- cypress/run
3038

3139
jobs:
32-
run_tests:
40+
install:
3341
working_directory: ~/saljuama.github.io
3442
docker:
3543
- image: circleci/node:14.15.1
@@ -44,6 +52,17 @@ jobs:
4452
paths:
4553
- node_modules
4654
key: v1-dependencies-{{ checksum "package.json" }}
55+
56+
run_tests:
57+
working_directory: ~/saljuama.github.io
58+
docker:
59+
- image: circleci/node:14.15.1
60+
steps:
61+
- checkout
62+
- restore_cache:
63+
keys:
64+
- v1-dependencies-{{ checksum "package.json" }}
65+
- v1-dependencies-
4766
- run: yarn test
4867

4968
publish_github_page:

cypress.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"baseUrl": "http://localhost:3000"
2+
"baseUrl": "http://localhost:5000"
33
}

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
"clean": "eslint \"src/**/*.js\" --fix",
1010
"start": "react-scripts start",
1111
"build": "react-scripts build",
12-
"predeploy": "npm run build",
12+
"serve": "yarn build && serve -s build",
13+
"predeploy": "yarn build",
1314
"deploy": "gh-pages -b gh-pages -e ./docs -d build"
1415
},
1516
"dependencies": {
@@ -33,7 +34,8 @@
3334
"cypress": "^6.8.0",
3435
"gh-pages": "^3.1.0",
3536
"node-sass": "4.14.1",
36-
"react-scripts": "4.0.3"
37+
"react-scripts": "4.0.3",
38+
"serve": "^11.3.2"
3739
},
3840
"browserslist": {
3941
"production": [

0 commit comments

Comments
 (0)