Skip to content

Commit 6e52b8d

Browse files
authored
Merge pull request #98 from CodeYourFuture/chore/e2e-v2
Backfill Cypress E2E tests then upgrade all dependencies
2 parents c830ad3 + b5ad826 commit 6e52b8d

26 files changed

+6634
-11464
lines changed

.circleci/config.yml

Lines changed: 43 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,34 +24,66 @@ commands:
2424
--paths /\*
2525
2626
jobs:
27+
test:
28+
docker:
29+
- image: cypress/base:16.17.1
30+
working_directory: ~/repo
31+
steps:
32+
- checkout
33+
- restore_cache:
34+
keys:
35+
- yarn-dependencies-cypress-{{ checksum "yarn.lock" }}
36+
- yarn-dependencies-cypress-
37+
- run:
38+
name: Install dependencies
39+
command: yarn install --frozen-lockfile
40+
- save_cache:
41+
key: yarn-dependencies-cypress-{{ checksum "yarn.lock" }}
42+
paths:
43+
- ~/.cache
44+
- run: yarn lint
45+
- run: yarn e2e:prod
2746
build:
2847
docker:
29-
- image: circleci/node:11.12
48+
- image: cimg/node:16.17.1
3049
working_directory: ~/repo
3150
steps:
3251
- checkout
3352
- restore_cache:
3453
keys:
35-
- yarn-dependencies-{{ checksum "package.json" }}
54+
- yarn-dependencies-node-{{ checksum "yarn.lock" }}
55+
- yarn-dependencies-node-
3656
- run:
3757
name: Install dependencies
38-
command: yarn
58+
command: yarn install --frozen-lockfile
3959
- save_cache:
40-
key: yarn-dependencies-{{ checksum "package.json" }}
60+
key: yarn-dependencies-node-{{ checksum "yarn.lock" }}
4161
paths:
4262
- ~/.cache
4363
- run:
4464
name: Set env variables
4565
command: echo 'export VERSION=$(echo $CIRCLE_SHA1 | cut -c -7)' >> $BASH_ENV
4666
- run:
4767
name: build qa
48-
command: REACT_APP_NODE_ENV=QA yarn build:qa
68+
command: yarn build
69+
environment:
70+
BUILD_PATH: 'qa'
71+
GENERATE_SOURCEMAP: 'false'
72+
REACT_APP_NODE_ENV: 'QA'
4973
- run:
5074
name: build staging
51-
command: REACT_APP_NODE_ENV=STAGING yarn build:staging
75+
command: yarn build
76+
environment:
77+
BUILD_PATH: 'staging'
78+
GENERATE_SOURCEMAP: 'false'
79+
REACT_APP_NODE_ENV: 'STAGING'
5280
- run:
5381
name: build production
54-
command: REACT_APP_NODE_ENV=PRODUCTION yarn build:production
82+
command: yarn build
83+
environment:
84+
BUILD_PATH: 'production'
85+
GENERATE_SOURCEMAP: 'false'
86+
REACT_APP_NODE_ENV: 'PRODUCTION'
5587
- persist_to_workspace:
5688
root: .
5789
paths:
@@ -79,7 +111,6 @@ jobs:
79111
to: 'forms.qa.codeyourfuture.io'
80112
cf_distribution_id: E2VFUDC8YCDBKS
81113

82-
83114
deploy_staging:
84115
docker:
85116
- image: circleci/python:3.6-jessie
@@ -124,8 +155,12 @@ workflows:
124155
version: 2
125156
test_and_deploy:
126157
jobs:
158+
- test:
159+
context: build
127160
- build:
128161
context: build
162+
requires:
163+
- test
129164
- deploy_qa:
130165
context: deployments_qa
131166
requires:

.eslintrc

Lines changed: 0 additions & 17 deletions
This file was deleted.

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
# testing
99
/coverage
1010
/e2e/screenshots
11+
/e2e/videos
1112

1213
# production
1314
/build
@@ -43,4 +44,3 @@ npm-debug.log*
4344
yarn-debug.log*
4445
yarn-error.log*
4546
.env
46-
package-lock.json

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
yarn lint-staged

.prettierrc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
{
2+
"arrowParens": "avoid",
23
"bracketSpacing": true,
4+
"semi": false,
35
"singleQuote": true,
46
"tabWidth": 2,
5-
"useTabs": false,
67
"trailingComma": "none",
7-
"semi": false
8-
}
8+
"useTabs": false
9+
}

config-overrides.js

Lines changed: 0 additions & 26 deletions
This file was deleted.

cypress.config.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
const { defineConfig } = require('cypress')
2+
3+
module.exports = defineConfig({
4+
e2e: {
5+
baseUrl: 'http://localhost:3000',
6+
specPattern: 'e2e/integration/*.test.js',
7+
supportFile: 'e2e/support/index.js'
8+
},
9+
fixturesFolder: 'e2e/fixtures',
10+
screenshotsFolder: 'e2e/screenshots',
11+
videosFolder: 'e2e/videos',
12+
video: false
13+
})

cypress.json

Lines changed: 0 additions & 10 deletions
This file was deleted.

e2e/.eslintrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"extends": [
3+
"plugin:cypress/recommended"
4+
]
5+
}

e2e/fixtures/cities.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"cities": [
3+
{
4+
"_id": "123abc",
5+
"name": "London"
6+
}
7+
]
8+
}

0 commit comments

Comments
 (0)