test: improve expect.toHaveBeenWarned() message
This commit is contained in:
parent
59e58cd4a5
commit
b742384313
@ -12,7 +12,10 @@ expect.extend({
|
||||
return {
|
||||
pass: false,
|
||||
message: () =>
|
||||
`expected "${received}" to have been warned.\n\nActual messages:\n\n - ${msgs}`
|
||||
`expected "${received}" to have been warned` +
|
||||
(msgs.length
|
||||
? `.\n\nActual messages:\n\n - ${msgs}`
|
||||
: ` but no warning was recorded.`)
|
||||
}
|
||||
}
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user