@@ -5018,6 +5018,10 @@ describe('tests targeting the FixtureOptions interface', () => {
5018
5018
5019
5019
await runPluginTester (
5020
5020
getDummyPluginOptions ( {
5021
+ // ? We have to do this once at the beginning because the signal-exit
5022
+ // ? package dark magic deep in node/npm internals has side-effects on
5023
+ // ? assert.equal
5024
+ setup : ( ) => void equalSpy . mockClear ( ) ,
5021
5025
fixtures : getFixturePath ( 'creates-output-file' )
5022
5026
} )
5023
5027
) ;
@@ -5035,6 +5039,7 @@ describe('tests targeting the FixtureOptions interface', () => {
5035
5039
5036
5040
await runPluginTester (
5037
5041
getDummyPresetOptions ( {
5042
+ setup : ( ) => void equalSpy . mockClear ( ) ,
5038
5043
fixtures : getFixturePath ( 'option-fixtureOutputName' )
5039
5044
} )
5040
5045
) ;
@@ -5053,6 +5058,7 @@ describe('tests targeting the FixtureOptions interface', () => {
5053
5058
5054
5059
await runPluginTester (
5055
5060
getDummyPluginOptions ( {
5061
+ setup : ( ) => void equalSpy . mockClear ( ) ,
5056
5062
fixtures : getFixturePath ( 'option-fixtureOutputExt' )
5057
5063
} )
5058
5064
) ;
@@ -5073,6 +5079,10 @@ describe('tests targeting the FixtureOptions interface', () => {
5073
5079
5074
5080
await runPluginTester (
5075
5081
getDummyPluginOptions ( {
5082
+ // ? We have to do this once at the beginning because the signal-exit
5083
+ // ? package dark magic deep in node/npm internals has side-effects on
5084
+ // ? assert.equal
5085
+ setup : ( ) => void equalSpy . mockClear ( ) ,
5076
5086
fixtures : getFixturePath ( 'option-fixtureOutputExt' )
5077
5087
} )
5078
5088
) ;
@@ -5091,6 +5101,7 @@ describe('tests targeting the FixtureOptions interface', () => {
5091
5101
5092
5102
await runPluginTester (
5093
5103
getDummyPresetOptions ( {
5104
+ setup : ( ) => void equalSpy . mockClear ( ) ,
5094
5105
fixtures : getFixturePath ( 'option-fixtureOutputExt-no-dot' )
5095
5106
} )
5096
5107
) ;
@@ -5111,13 +5122,32 @@ describe('tests targeting the TestObject interface', () => {
5111
5122
it ( 'accepts an array value for `tests`' , async ( ) => {
5112
5123
expect . hasAssertions ( ) ;
5113
5124
5114
- await runPluginTester ( getDummyPluginOptions ( { tests : [ simpleTest ] } ) ) ;
5115
- await runPluginTester ( getDummyPresetOptions ( { tests : [ simpleTest ] } ) ) ;
5125
+ await runPluginTester (
5126
+ getDummyPluginOptions ( {
5127
+ // ? We have to do this once at the beginning because the signal-exit
5128
+ // ? package dark magic deep in node/npm internals has side-effects on
5129
+ // ? assert.equal
5130
+ setup : ( ) => void equalSpy . mockClear ( ) ,
5131
+ tests : [ simpleTest ]
5132
+ } )
5133
+ ) ;
5134
+
5135
+ expect ( itSpy ) . toHaveBeenCalledTimes ( 1 ) ;
5136
+
5137
+ expect ( equalSpy . mock . calls ) . toMatchObject ( [
5138
+ [ simpleTest , simpleTest , expect . any ( String ) ]
5139
+ ] ) ;
5140
+
5141
+ await runPluginTester (
5142
+ getDummyPresetOptions ( {
5143
+ setup : ( ) => void equalSpy . mockClear ( ) ,
5144
+ tests : [ simpleTest ]
5145
+ } )
5146
+ ) ;
5116
5147
5117
5148
expect ( itSpy ) . toHaveBeenCalledTimes ( 2 ) ;
5118
5149
5119
5150
expect ( equalSpy . mock . calls ) . toMatchObject ( [
5120
- [ simpleTest , simpleTest , expect . any ( String ) ] ,
5121
5151
[ simpleTest , simpleTest , expect . any ( String ) ]
5122
5152
] ) ;
5123
5153
} ) ;
0 commit comments