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(); const page = await context.newPage();
await page.goto(server.PREFIX + '/modernizr.html'); await page.goto(server.PREFIX + '/modernizr.html');
const actual = await page.evaluate('window.report'); 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 }; return { actual, expected };
} finally { } finally {
await context.close(); await context.close();

View File

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