File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -4,9 +4,9 @@ vi.stubGlobal('MathMLElement', class MathMLElement {})
4
4
5
5
expect . extend ( {
6
6
toHaveBeenWarned ( received : string ) {
7
- asserted . add ( received )
8
7
const passed = warn . mock . calls . some ( args => args [ 0 ] . includes ( received ) )
9
8
if ( passed ) {
9
+ asserted . add ( received )
10
10
return {
11
11
pass : true ,
12
12
message : ( ) => `expected "${ received } " not to have been warned.` ,
@@ -25,10 +25,10 @@ expect.extend({
25
25
} ,
26
26
27
27
toHaveBeenWarnedLast ( received : string ) {
28
- asserted . add ( received )
29
28
const passed =
30
29
warn . mock . calls [ warn . mock . calls . length - 1 ] [ 0 ] . includes ( received )
31
30
if ( passed ) {
31
+ asserted . add ( received )
32
32
return {
33
33
pass : true ,
34
34
message : ( ) => `expected "${ received } " not to have been warned last.` ,
@@ -44,7 +44,6 @@ expect.extend({
44
44
} ,
45
45
46
46
toHaveBeenWarnedTimes ( received : string , n : number ) {
47
- asserted . add ( received )
48
47
let found = 0
49
48
warn . mock . calls . forEach ( args => {
50
49
if ( args [ 0 ] . includes ( received ) ) {
@@ -53,6 +52,7 @@ expect.extend({
53
52
} )
54
53
55
54
if ( found === n ) {
55
+ asserted . add ( received )
56
56
return {
57
57
pass : true ,
58
58
message : ( ) => `expected "${ received } " to have been warned ${ n } times.` ,
You can’t perform that action at this time.
0 commit comments