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 1313 NPM_CLIENT :
1414 type : string
1515 default : ' yarn'
16+ RUN_FULL_TESTS :
17+ type : boolean
18+ default : ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') }}
19+ workflow_dispatch :
20+ inputs :
21+ RUN_FULL_TESTS :
22+ type : boolean
23+ default : true
1624
1725jobs :
1826 pipeline :
5361
5462 - name : Run end-to-end tests
5563 run : |
56- if [[ "$GITHUB_REF " == "refs/heads/main" ]] || [[ "$GITHUB_REF" =~ ^refs/heads/release/ ]]; then
64+ if [[ "${{ inputs.RUN_FULL_TESTS }} " == "true" ]]; then
5765 yarn e2etest:full
5866 else
5967 yarn e2etest:smoketest
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