@@ -50,7 +50,7 @@ test("parseRemoteFileAddress accepts full remote addresses", async (t) => {
5050 for ( const oldFormatInput of oldFormatInputs ) {
5151 await target
5252 . withArgs ( oldFormatInput . input )
53- . passes ( async ( fn ) => t . deepEqual ( await fn ( ) , oldFormatInput . expected ) ) ;
53+ . passes ( t . deepEqual , oldFormatInput . expected ) ;
5454 }
5555
5656 // New format.
@@ -78,14 +78,12 @@ test("parseRemoteFileAddress accepts full remote addresses", async (t) => {
7878 // Should fail when the FF is not enabled.
7979 await targetWithArgs
8080 . withFeatures ( [ ] )
81- . passes ( async ( fn ) =>
82- t . throwsAsync ( fn , { instanceOf : ConfigurationError } ) ,
83- ) ;
81+ . throws ( t , { instanceOf : ConfigurationError } ) ;
8482
8583 // And pass when the FF is enabled.
8684 await targetWithArgs
8785 . withFeatures ( [ Feature . NewRemoteFileAddresses ] )
88- . passes ( async ( fn ) => t . deepEqual ( await fn ( ) , newFormatInput . expected ) ) ;
86+ . passes ( t . deepEqual , newFormatInput . expected ) ;
8987 }
9088} ) ;
9189
@@ -146,14 +144,12 @@ test("parseRemoteFileAddress accepts remote address without an owner", async (t)
146144 // Should fail when the FF is not enabled.
147145 await targetWithArgs
148146 . withFeatures ( [ ] )
149- . passes ( async ( fn ) =>
150- t . throwsAsync ( fn , { instanceOf : ConfigurationError } ) ,
151- ) ;
147+ . throws ( t , { instanceOf : ConfigurationError } ) ;
152148
153149 // And pass when the FF is enabled.
154150 await targetWithArgs
155151 . withFeatures ( [ Feature . NewRemoteFileAddresses ] )
156- . passes ( async ( fn ) => t . deepEqual ( await fn ( ) , testCase . expected ) ) ;
152+ . passes ( t . deepEqual , testCase . expected ) ;
157153 }
158154} ) ;
159155
@@ -167,7 +163,7 @@ test("parseRemoteFileAddress throws for invalid `GITHUB_REPOSITORY`", async (t)
167163 await target
168164 . withEnv ( env )
169165 . withFeatures ( [ Feature . NewRemoteFileAddresses ] )
170- . passes ( async ( fn ) => t . throwsAsync ( fn , { instanceOf : Error } ) ) ;
166+ . throws ( t , { instanceOf : Error } ) ;
171167
172168 t . assert ( getRequired . calledOnceWith ( ActionsEnvVars . GITHUB_REPOSITORY ) ) ;
173169} ) ;
@@ -202,32 +198,28 @@ test("parseRemoteFileAddress accepts remote address without a path", async (t) =
202198 // Should fail when the FF is not enabled.
203199 await targetWithArgs
204200 . withFeatures ( [ ] )
205- . passes ( async ( fn ) =>
206- t . throwsAsync ( fn , { instanceOf : ConfigurationError } ) ,
207- ) ;
201+ . throws ( t , { instanceOf : ConfigurationError } ) ;
208202
209203 // And pass when the FF is enabled.
210204 await targetWithArgs
211205 . withFeatures ( [ Feature . NewRemoteFileAddresses ] )
212- . passes ( async ( fn ) => t . deepEqual ( await fn ( ) , testCase . expected ) ) ;
206+ . passes ( t . deepEqual , testCase . expected ) ;
213207 }
214208} ) ;
215209
216210test ( "parseRemoteFileAddress accepts remote address without a ref" , async ( t ) => {
217211 const target = callee ( parseRemoteFileAddress ) . withArgs ( "owner/repo:path" ) ;
218212
219213 // Should only accept the input if the FF is enabled.
220- await target . withFeatures ( [ ] ) . passes ( t . throwsAsync ) ;
214+ await target . withFeatures ( [ ] ) . throws ( t ) ;
221215 await target
222216 . withFeatures ( [ Feature . NewRemoteFileAddresses ] )
223- . passes ( async ( fn ) =>
224- t . deepEqual ( await fn ( ) , {
225- owner : "owner" ,
226- repo : "repo" ,
227- path : "path" ,
228- ref : DEFAULT_CONFIG_FILE_REF ,
229- } satisfies RemoteFileAddress ) ,
230- ) ;
217+ . passes ( t . deepEqual , {
218+ owner : "owner" ,
219+ repo : "repo" ,
220+ path : "path" ,
221+ ref : DEFAULT_CONFIG_FILE_REF ,
222+ } satisfies RemoteFileAddress ) ;
231223} ) ;
232224
233225test ( "parseRemoteFileAddress rejects invalid values" , async ( t ) => {
@@ -262,21 +254,17 @@ test("parseRemoteFileAddress rejects invalid values", async (t) => {
262254 const targetWithArgs = target . withArgs ( testInput ) ;
263255
264256 // Should throw both when the new format is and isn't accepted.
265- await targetWithArgs . withFeatures ( [ ] ) . passes ( async ( fn ) =>
266- t . throwsAsync ( fn , {
267- instanceOf : ConfigurationError ,
268- message : errors . getConfigFileRepoOldFormatInvalidMessage ( testInput ) ,
269- } ) ,
270- ) ;
257+ await targetWithArgs . withFeatures ( [ ] ) . throws ( t , {
258+ instanceOf : ConfigurationError ,
259+ message : errors . getConfigFileRepoOldFormatInvalidMessage ( testInput ) ,
260+ } ) ;
271261 await targetWithArgs
272262 . withFeatures ( [ Feature . NewRemoteFileAddresses ] )
273- . passes ( async ( fn ) =>
274- t . throwsAsync ( fn , {
275- // When the new format is accepted, there are some more specific
276- // errors in some cases. It is sufficient for us to check that
277- // an exception is thrown.
278- instanceOf : ConfigurationError ,
279- } ) ,
280- ) ;
263+ . throws ( t , {
264+ // When the new format is accepted, there are some more specific
265+ // errors in some cases. It is sufficient for us to check that
266+ // an exception is thrown.
267+ instanceOf : ConfigurationError ,
268+ } ) ;
281269 }
282270} ) ;
0 commit comments