mirror of
https://github.com/facebook/docusaurus.git
synced 2025-12-26 01:33:02 +00:00
chore(v2): Implement a simple E2E testing mechanism for `docusausus start` (#2950)
* chore(v2): Implement a simple E2E testing mechanism for `docusausus start` * Detect compiler errors
This commit is contained in:
parent
fa99aeb6d4
commit
592dca9196
|
|
@ -26,6 +26,10 @@ jobs:
|
|||
run: yarn
|
||||
- name: Setup test-website project against master release
|
||||
run: yarn test:build:v2
|
||||
- name: Start test-website project
|
||||
run: cd test-website && yarn start --no-open
|
||||
env:
|
||||
E2E_TEST: true
|
||||
- name: Build test-website project
|
||||
run: cd test-website && yarn build
|
||||
env:
|
||||
|
|
|
|||
|
|
@ -165,6 +165,16 @@ export default async function start(
|
|||
...config.devServer,
|
||||
};
|
||||
const compiler = webpack(config);
|
||||
if (process.env.E2E_TEST) {
|
||||
compiler.hooks.done.tap('done', (stats) => {
|
||||
if (stats.hasErrors()) {
|
||||
console.log('E2E_TEST: Project has compiler errors.');
|
||||
process.exit(1);
|
||||
}
|
||||
console.log('E2E_TEST: Project can compile.');
|
||||
process.exit(0);
|
||||
});
|
||||
}
|
||||
const devServer = new WebpackDevServer(compiler, devServerConfig);
|
||||
devServer.listen(port, host, (err) => {
|
||||
if (err) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue