Skip to content

Commit

Permalink
chore(test): check exit code in e2e setup (#698)
Browse files Browse the repository at this point in the history
* chore(test): check exit code in e2e setup

* fix: cannot use `cause`
  • Loading branch information
cristiand391 authored May 3, 2023
1 parent b9909f7 commit 6ee41f9
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions test/integration/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,19 @@ export async function setup(testFile: string, options: Options): Promise<Executo

const install = 'yarn install --force'
console.log(chalk.cyan(`${testFileName}:`), install)
await executor.executeInTestDir(install)
const yarnInstallRes = await executor.executeInTestDir(install, false)
if (yarnInstallRes.code !== 0) {
console.error(yarnInstallRes?.error)
throw new Error('Failed to run `yarn install`')
}

const build = 'yarn build'
console.log(chalk.cyan(`${testFileName}:`), build)
await executor.executeInTestDir(build)
const yarnBuildRes = await executor.executeInTestDir(build, false)
if (yarnBuildRes.code !== 0) {
console.error(yarnBuildRes?.error)
throw new Error('Failed to run `yarn build`')
}

return executor
}

0 comments on commit 6ee41f9

Please sign in to comment.