File tree Expand file tree Collapse file tree
packages/delegator-e2e/test/caveats Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -177,13 +177,13 @@ test('Bob attempts to redeem the delegation without providing a valid permission
177177 ) ,
178178 } ) ;
179179
180- const permissionsContext = '0x' ;
180+ const permissionsContext = '0x' as const ;
181181
182182 await runTest_expectFailure (
183183 delegationRequiringNativeTokenPayment ,
184184 permissionsContext ,
185185 recipient ,
186- '' , // The NativeTokenPaymentEnforcer rejects when it fails to decode the permissions context
186+ undefined , // The NativeTokenPaymentEnforcer rejects when it fails to decode the permissions context
187187 ) ;
188188} ) ;
189189
@@ -295,15 +295,21 @@ const runTest_expectFailure = async (
295295 delegation : Delegation ,
296296 permissionsContext : Hex ,
297297 recipient : Address ,
298- expectedError : string ,
298+ expectedError : string | undefined ,
299299) => {
300300 const balanceBefore = await publicClient . getBalance ( {
301301 address : recipient ,
302302 } ) ;
303303
304- await expect (
304+ const rejects = expect (
305305 submitUserOpForTest ( delegation , permissionsContext ) ,
306- ) . rejects . toThrow ( expectedError ) ;
306+ ) . rejects ;
307+
308+ if ( expectedError ) {
309+ await rejects . toThrow ( expectedError ) ;
310+ } else {
311+ await rejects . toThrow ( ) ;
312+ }
307313
308314 const balanceAfter = await publicClient . getBalance ( {
309315 address : recipient ,
You can’t perform that action at this time.
0 commit comments