Skip to content

Commit 35dc7f3

Browse files
authored
Fix(vite-react-microfrontends): Fix e2e CI run. (#2769)
* Fix(vite-react-microfrontends): Fix e2e CI run. * Fix(vite-react-microfrontends): Fix e2e CI run. * Fix(vite-react-microfrontends): Fix e2e CI run. * Fix(vite-react-microfrontends): Fix e2e CI run.
1 parent a90f335 commit 35dc7f3

File tree

3 files changed

+1427
-2
lines changed

3 files changed

+1427
-2
lines changed

vite-react-microfrontends/e2e.ci.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
const concurrently = require('concurrently');
2+
const commands = {
3+
startHost: 'yarn serve:host',
4+
startRemote: 'yarn serve:remote',
5+
startE2e: 'yarn e2e:test'
6+
};
7+
8+
const {result} = concurrently([
9+
commands.startHost,
10+
commands.startRemote,
11+
commands.startE2e
12+
], {
13+
killOthers: ['failure', 'success'],
14+
});
15+
16+
function handleClose(exitInfo) {
17+
const testResult = exitInfo.find(info => info.command.command === commands.startE2e);
18+
process.exit(testResult.exitCode);
19+
}
20+
21+
result.then(handleClose, handleClose);

vite-react-microfrontends/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
"build:remote": "npm --prefix ./remote run build",
1818
"preview:host": "npm --prefix ./host run preview",
1919
"preview:remote": "npm --prefix ./remote run preview",
20-
"e2e:ci": "yarn preview:remote & yarn preview:host & wait-on http-get://localhost:4174/ && npx cypress run --config-file ../cypress/config/cypress.config.ts --config '{\"supportFile\": \"../cypress/support/e2e.ts\"}' --spec \"./e2e/tests/runAll*.cy.ts\" --browser=chrome"
20+
"e2e:test": "npx cypress run --config-file ../cypress/config/cypress.config.ts --config '{\"supportFile\": \"../cypress/support/e2e.ts\"}' --spec \"./e2e/tests/runAll*.cy.ts\" --browser=chrome",
21+
"e2e:ci": "node e2e.ci.js"
2122
},
2223
"author": {
2324
"name": "Giorgio Boa",
@@ -26,6 +27,7 @@
2627
},
2728
"license": "ISC",
2829
"devDependencies": {
30+
"concurrently": "7.3.0",
2931
"wait-on": "7.0.1"
3032
}
3133
}

0 commit comments

Comments
 (0)