test: improve unexpected warning output
This commit is contained in:
parent
7e8b26eba8
commit
a5e55e28f1
@ -80,9 +80,10 @@ afterEach(() => {
|
|||||||
})
|
})
|
||||||
warn.mockRestore()
|
warn.mockRestore()
|
||||||
if (nonAssertedWarnings.length) {
|
if (nonAssertedWarnings.length) {
|
||||||
nonAssertedWarnings.forEach(warning => {
|
throw new Error(
|
||||||
console.warn(warning)
|
`test case threw unexpected warnings:\n - ${nonAssertedWarnings.join(
|
||||||
})
|
'\n - '
|
||||||
throw new Error(`test case threw unexpected warnings.`)
|
)}`
|
||||||
|
)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user