Skip to content

Commit

Permalink
test: improve unexpected warning output
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Jul 28, 2020
1 parent 7e8b26e commit a5e55e2
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions scripts/setupJestEnv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,10 @@ afterEach(() => {
})
warn.mockRestore()
if (nonAssertedWarnings.length) {
nonAssertedWarnings.forEach(warning => {
console.warn(warning)
})
throw new Error(`test case threw unexpected warnings.`)
throw new Error(
`test case threw unexpected warnings:\n - ${nonAssertedWarnings.join(
'\n - '
)}`
)
}
})

0 comments on commit a5e55e2

Please sign in to comment.