Skip to content

Commit

Permalink
🐛 fix: Throw if expecting error in dev server fixture (#596)
Browse files Browse the repository at this point in the history
## Description

Throw in dev server if the fixture is supposed to throw but doesnt

## Testing

Explain the quality checks that have been done on the code changes

## Additional Information

- [ ] I read the [contributing docs](../docs/contributing.md) (if this
is your first contribution)

Your ENS/address:

Co-authored-by: Will Cory <[email protected]>
  • Loading branch information
roninjin10 and Will Cory committed Oct 23, 2023
1 parent 64a404c commit 4895f92
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions config/scripts/runFixture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,20 @@ export const runFixture = (name: string) => {
runSync(
provide(
loadConfig(configDir).pipe(
flatMap(config => {
if (expectedErrors.includes(validName)) {
return fail(config)
}
return succeed(config)
}),
catchAll((e) => {
if (expectedErrors.includes(validName)) {
return succeed(e)
}
return logError(
`error running ${validName} ${
expectedErrors.includes(validName)
? `should have errored but didn't`
: 'error'
`error running ${validName} ${expectedErrors.includes(validName)
? `should have errored but didn't`
: 'error'
}. Try running the individual fixture with "bun fixture ${validName}"`,
).pipe(flatMap(() => fail(e)))
}),
Expand Down

0 comments on commit 4895f92

Please sign in to comment.