diff --git a/.github/workflows/end-to-end-tests.yml b/.github/workflows/end-to-end-tests.yml index b5e278eb..81f0be6a 100644 --- a/.github/workflows/end-to-end-tests.yml +++ b/.github/workflows/end-to-end-tests.yml @@ -13,6 +13,14 @@ on: NPM_CLIENT: type: string default: 'yarn' + RUN_FULL_TESTS: + type: boolean + default: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') }} + workflow_dispatch: + inputs: + RUN_FULL_TESTS: + type: boolean + default: true jobs: pipeline: @@ -53,7 +61,7 @@ jobs: - name: Run end-to-end tests run: | - if [[ "$GITHUB_REF" == "refs/heads/main" ]] || [[ "$GITHUB_REF" =~ ^refs/heads/release/ ]]; then + if [[ "${{ inputs.RUN_FULL_TESTS }}" == "true" ]]; then yarn e2etest:full else yarn e2etest:smoketest diff --git a/packages/delegator-e2e/test/caveats/nativeTokenPayment.test.ts b/packages/delegator-e2e/test/caveats/nativeTokenPayment.test.ts index 5cd55392..7f67ceba 100644 --- a/packages/delegator-e2e/test/caveats/nativeTokenPayment.test.ts +++ b/packages/delegator-e2e/test/caveats/nativeTokenPayment.test.ts @@ -177,13 +177,13 @@ test('Bob attempts to redeem the delegation without providing a valid permission ), }); - const permissionsContext = '0x'; + const permissionsContext = '0x' as const; await runTest_expectFailure( delegationRequiringNativeTokenPayment, permissionsContext, recipient, - '', // The NativeTokenPaymentEnforcer rejects when it fails to decode the permissions context + undefined, // The NativeTokenPaymentEnforcer rejects when it fails to decode the permissions context ); }); @@ -295,15 +295,21 @@ const runTest_expectFailure = async ( delegation: Delegation, permissionsContext: Hex, recipient: Address, - expectedError: string, + expectedError: string | undefined, ) => { const balanceBefore = await publicClient.getBalance({ address: recipient, }); - await expect( + const rejects = expect( submitUserOpForTest(delegation, permissionsContext), - ).rejects.toThrow(expectedError); + ).rejects; + + if (expectedError) { + await rejects.toThrow(expectedError); + } else { + await rejects.toThrow(); + } const balanceAfter = await publicClient.getBalance({ address: recipient,