Skip to content

Commit e81d5b7

Browse files
authored
add: cra sample to ci (#2738)
1 parent eb0500d commit e81d5b7

File tree

5 files changed

+26
-9
lines changed

5 files changed

+26
-9
lines changed

cra/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,11 @@ Run `yarn start`. This will build and serve both `host` and `remote` on ports 30
1111

1212
- [localhost:3001](http://localhost:3000/) (HOST)
1313
- [localhost:3002](http://localhost:3002/) (STANDALONE REMOTE)
14+
15+
# Running Cypress E2E Tests
16+
17+
To run tests in interactive mode, run `npm run cypress:debug` from the root directory of the project. It will open Cypress Test Runner and allow to run tests in interactive mode. [More info about "How to run tests"](../../cypress/README.md#how-to-run-tests)
18+
19+
To build app and run test in headless mode, run `yarn e2e:ci`. It will build app and run tests for this workspace in headless mode. If tets failed cypress will create `cypress` directory in sample root folder with screenshots and videos.
20+
21+
["Best Practices, Rules amd more interesting information here](../../cypress/README.md)

cra/host/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@cra/host",
2+
"name": "cra_host",
33
"version": "0.0.0",
44
"private": true,
55
"dependencies": {
@@ -8,7 +8,8 @@
88
"react-scripts": "5.0.1"
99
},
1010
"scripts": {
11-
"start": "node ./scripts/start.js",
11+
"start": "forever start ./scripts/start.js",
12+
"stop": "forever stop ./scripts/start.js",
1213
"build": "node ./scripts/build.js",
1314
"test": "react-scripts test",
1415
"eject": "react-scripts eject"

cra/package.json

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,16 @@
88
]
99
},
1010
"scripts": {
11-
"start": "concurrently 'cd ./host && yarn start' 'cd ./remote && yarn start'",
12-
"build": "concurrently 'cd ./host && yarn build' 'cd ./remote && yarn build'",
13-
"serve": "concurrently 'cd ./host && yarn serve' 'cd ./remote && yarn serve'",
14-
"clean": "concurrently 'cd ./host && yarn clean' 'cd ./remote && yarn clean'"
11+
"start": "lerna run --scope=cra_* start",
12+
"stop": "lerna run --scope=cra_* stop",
13+
"build": "lerna run --scope=cra_* build'",
14+
"serve": "lerna run --scope=cra_* serve'",
15+
"clean": "lerna run --scope=cra_* clean'",
16+
"e2e:ci": "yarn start && npx cypress run --config-file ../cypress/config/cypress.config.ts --config '{\"supportFile\": \"../cypress/support/e2e.ts\"}' --spec \"./e2e/*.cy.ts\" --browser=chrome && yarn stop"
1517
},
1618
"devDependencies": {
17-
"concurrently": "7.3.0"
19+
"concurrently": "7.3.0",
20+
"forever": "4.0.3",
21+
"lerna": "3.22.1"
1822
}
1923
}

cra/remote/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@cra/remote",
2+
"name": "cra_remote",
33
"version": "0.0.0",
44
"private": true,
55
"dependencies": {
@@ -8,7 +8,8 @@
88
"react-scripts": "5.0.1"
99
},
1010
"scripts": {
11-
"start": "PORT=3002 node ./scripts/start.js",
11+
"start": "PORT=3002 forever start ./scripts/start.js",
12+
"stop": "PORT=3002 forever stop ./scripts/start.js",
1213
"build": "node ./scripts/build.js",
1314
"test": "react-scripts test",
1415
"eject": "react-scripts eject"

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141
"./comprehensive-demo-react16/*",
4242
"./comprehensive-demo-react18",
4343
"./comprehensive-demo-react18/*",
44+
"./cra",
45+
"./cra/*",
4446
"./css-isolation",
4547
"./css-isolation/*",
4648
"./delegate-modules",
@@ -135,6 +137,7 @@
135137
"cypress": "10",
136138
"cypress-fill-command": "1.0.2",
137139
"cypress-wait-until": "1.7.2",
140+
"forever": "4.0.3",
138141
"husky": "7.0.4",
139142
"jest": "26.6.3",
140143
"lerna": "6.4.1",

0 commit comments

Comments
 (0)