Skip to content

Commit c00ec5b

Browse files
authored
added: e2e tests to index (#2760)
1 parent 5e04c67 commit c00ec5b

File tree

10 files changed

+31
-9
lines changed

10 files changed

+31
-9
lines changed

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@
7474
"./react-nested-routers/*",
7575
"./react-nextjs/nextjs-host-react-remote",
7676
"./react-nextjs/nextjs-host-react-remote/*",
77+
"./react-nextjs/react-host-nextjs-remote",
78+
"./react-nextjs/react-host-nextjs-remote/*",
7779
"./react-nextjs/react-host-remote",
7880
"./react-nextjs/react-host-remote/*",
7981
"./redux-reducer-injection",

react-nextjs/react-host-nextjs-remote/host/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "host",
2+
"name": "react-host-nextjs-remote_host",
33
"version": "1.0.0",
44
"private": true,
55
"dependencies": {

react-nextjs/react-host-nextjs-remote/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
"description": "",
1010
"main": "index.js",
1111
"scripts": {
12-
"start": "concurrently \"cd host; npm run dev\" \"cd remote; npm run dev\""
12+
"start": "concurrently \"cd host; npm run dev\" \"cd remote; npm run dev\"",
13+
"e2e:ci": "yarn start & wait-on http-get://localhost:8080/ && npx cypress run --config-file ../../cypress/config/cypress.config.ts --config '{\"supportFile\": \"../../cypress/support/e2e.ts\"}' --spec \"./e2e/*.cy.ts\" --browser=chrome"
1314
},
1415
"author": "Omher",
1516
"license": "ISC",

react-nextjs/react-host-nextjs-remote/remote/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "remote",
2+
"name": "react-host-nextjs-remote_remote",
33
"version": "0.1.0",
44
"private": true,
55
"scripts": {

rollup-federation-demo/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,11 @@ Run `yarn start`. This will build and serve all three `webpack-spa`, `rollup-spa
1212
- SIDECAR (rollup-spa): [localhost:8080](http://localhost:8080/)
1313
- REMOTE (webpack-spa): [localhost:8081](http://localhost:8081/)
1414
- HOST (rollup-spa): [localhost:8082](http://localhost:8082/)
15+
16+
# Running Cypress E2E Tests
17+
18+
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)
19+
20+
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.
21+
22+
["Best Practices, Rules amd more interesting information here](../../cypress/README.md)

rollup-federation-demo/package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"name": "rollup-federation-demo",
23
"private": true,
34
"workspaces": {
45
"packages": [
@@ -8,9 +9,11 @@
89
]
910
},
1011
"scripts": {
11-
"start": "concurrently 'yarn --cwd rollup-spa start' 'yarn --cwd rs-sidecar start;' 'yarn --cwd webpack-spa start'"
12+
"start": "lerna run --scope=rollup-federation-demo_* start",
13+
"e2e:ci": "yarn start & wait-on http-get://localhost:8082/ && npx cypress run --config-file ../cypress/config/cypress.config.ts --config '{\"supportFile\": \"../cypress/support/e2e.ts\"}' --spec \"./e2e/tests/*.cy.ts\" --browser=chrome"
1214
},
1315
"devDependencies": {
14-
"concurrently": "7.3.0"
16+
"concurrently": "7.3.0",
17+
"lerna": "^6.4.1"
1518
}
1619
}

rollup-federation-demo/rollup-spa/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"name": "rollup-spa-systemjs",
2+
"name": "rollup-federation-demo_rollup-spa-systemjs",
33
"version": "1.0.0",
44
"main": "dist",
55
"license": "MIT",
66
"scripts": {
7-
"start": "run-p watch serve",
7+
"start": "concurrently 'yarn watch' 'yarn serve'",
88
"build": "cross-env NODE_ENV=development rollup -c",
99
"serve": "serve -d . -p 8082",
1010
"watch": "cross-env NODE_ENV=development rollup -c -w",

rollup-federation-demo/rs-sidecar/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "wp5-starter-react",
2+
"name": "rollup-federation-demo_wp5-starter-react",
33
"version": "1.0.0",
44
"scripts": {
55
"build": "webpack --mode production",

rollup-federation-demo/webpack-spa/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "webpack-spa-systemjs",
2+
"name": "rollup-federation-demo_webpack-spa-systemjs",
33
"version": "0.0.0",
44
"private": true,
55
"scripts": {

rust-wasm/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,3 +136,11 @@ This demo is built upon many OSS projects including:
136136
- [Webpack Module Federation](https://webpack.js.org/concepts/module-federation/) -> Used to share the Wasm module across apps
137137
- [The Offical Rust Wasm Docs](https://rustwasm.github.io/docs/book/game-of-life/implementing.html) -> Provided starter Game Of Life Code
138138
- [wasm-pack](https://rustwasm.github.io/wasm-pack/installer/) -> Webpack loader for compiling Rust to Wasm
139+
140+
# Running Cypress E2E Tests
141+
142+
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)
143+
144+
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.
145+
146+
["Best Practices, Rules amd more interesting information here](../../cypress/README.md)

0 commit comments

Comments
 (0)