Skip to content

Commit cace7d4

Browse files
committed
Don't unnecessarily kill test suite on missing warnings
1 parent 9b5031a commit cace7d4

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

tests.webpack.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,23 @@ beforeEach(() => {
1414
}
1515
}
1616

17+
console.error.threw = true
1718
throw new Error(msg)
1819
})
1920

2021
console.error.expected = []
2122
console.error.warned = Object.create(null)
23+
console.error.threw = false
2224
})
2325

2426
afterEach(() => {
25-
console.error.expected.forEach(about => {
26-
expect(console.error.warned[about]).toExist(
27-
`Missing expected warning: ${about}`
28-
)
29-
})
27+
if (!console.error.threw) {
28+
console.error.expected.forEach(about => {
29+
expect(console.error.warned[about]).toExist(
30+
`Missing expected warning: ${about}`
31+
)
32+
})
33+
}
3034

3135
console.error.restore()
3236
_resetWarned()

0 commit comments

Comments
 (0)