Skip to content

Commit a5e55e2

Browse files
committed
test: improve unexpected warning output
1 parent 7e8b26e commit a5e55e2

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

scripts/setupJestEnv.ts

+5-4
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,10 @@ afterEach(() => {
8080
})
8181
warn.mockRestore()
8282
if (nonAssertedWarnings.length) {
83-
nonAssertedWarnings.forEach(warning => {
84-
console.warn(warning)
85-
})
86-
throw new Error(`test case threw unexpected warnings.`)
83+
throw new Error(
84+
`test case threw unexpected warnings:\n - ${nonAssertedWarnings.join(
85+
'\n - '
86+
)}`
87+
)
8788
}
8889
})

0 commit comments

Comments
 (0)