fix(test): follow up to tests refactoring (#13085)

This commit is contained in:
Pavel Feldman 2022-03-25 21:11:29 -08:00 committed by GitHub
parent 02cac8a066
commit a454328c25
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -22,7 +22,7 @@ async function checkFeatures(name: string, context: any, server: any) {
const page = await context.newPage();
await page.goto(server.PREFIX + '/modernizr.html');
const actual = await page.evaluate('window.report');
const expected = JSON.parse(fs.readFileSync(require.resolve(`./assets/modernizr/${name}.json`), 'utf-8'));
const expected = JSON.parse(fs.readFileSync(require.resolve(`../assets/modernizr/${name}.json`), 'utf-8'));
return { actual, expected };
} finally {
await context.close();

View File

@ -95,7 +95,7 @@ async function runWatch() {
if (onChange.script)
child_process.spawnSync('node', [onChange.script], { stdio: 'inherit' });
else
child_process.spawnSync(onChange.command, onChange.args || [], { stdio: 'inherit', cwd: onChange.cwd });
child_process.spawnSync(onChange.command, onChange.args || [], { stdio: 'inherit', cwd: onChange.cwd, shell: true });
}
// chokidar will report all files as added in a sync loop, throttle those.
const reschedule = () => {
@ -166,7 +166,7 @@ async function runBuild() {
if (onChange.script)
runStep({ command: 'node', args: [filePath(onChange.script)], shell: false });
else
runStep({ command: onChange.command, args: onChange.args, shell: false, cwd: onChange.cwd });
runStep({ command: onChange.command, args: onChange.args, shell: true, cwd: onChange.cwd });
}
}
@ -265,7 +265,7 @@ onChanges.push({
],
command: 'npx',
args: ['vite', 'build'],
cwd: 'packages/trace-viewer',
cwd: path.join(__dirname, '..', '..', 'packages', 'trace-viewer'),
});
onChanges.push({
@ -279,7 +279,7 @@ onChanges.push({
],
command: 'npx',
args: ['vite', 'build'],
cwd: 'packages/recorder',
cwd: path.join(__dirname, '..', '..', 'packages', 'recorder'),
});
// The recorder and trace viewer have an app_icon.png that needs to be copied.