Skip to content

Commit 5c6de33

Browse files
committed
test: deal with errors thrown from child processes
1 parent 59a2292 commit 5c6de33

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

snapshot.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,18 @@ const playgroundDir = new URL('./playground/', import.meta.url).pathname
66
function createProjectWithFeatureFlags(flags) {
77
const projectName = flags.join('-')
88
console.log(`Creating project ${projectName}`)
9-
spawnSync('node', [bin, projectName, ...flags.map((flag) => `--${flag}`), '--force'], {
10-
cwd: playgroundDir
11-
})
9+
const { status } = spawnSync(
10+
'node',
11+
[bin, projectName, ...flags.map((flag) => `--${flag}`), '--force'],
12+
{
13+
cwd: playgroundDir,
14+
stdio: ['pipe', 'pipe', 'inherit']
15+
}
16+
)
17+
18+
if (status !== 0) {
19+
process.exit(status)
20+
}
1221
}
1322

1423
const featureFlags = ['typescript', 'jsx', 'router', 'vuex', 'with-tests']

0 commit comments

Comments
 (0)