fix(gatsby): fix the e2e for gatsby production (#5353)

fix the issue where gastby production serve does not get resolve
This commit is contained in:
Emily Xiong 2021-04-19 15:07:03 -04:00 committed by GitHub
parent fb0411ee8f
commit 7063525851
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -119,6 +119,16 @@ function runGatsbyServe(
{ cwd: join(workspaceRoot, projectRoot) }
);
childProcess.on('message', ({ action }: any) => {
if (
action?.type === 'LOG' &&
action?.payload?.text?.includes(options.host) &&
action?.payload?.text?.includes(options.port)
) {
resolve(true);
}
});
childProcess.on('error', (err) => {
reject(err);
});