From 5612c28b6ea40abd4bec06b47b98859a61fc1bb9 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Tue, 13 Aug 2024 10:18:35 +0200 Subject: [PATCH] ci: return typecheck step (#6334) --- .github/workflows/ci.yml | 21 ++++++++++++++++++- .../browser/src/client/tester/unhandled.ts | 4 ++-- packages/vitest/src/integrations/env/jsdom.ts | 4 ++-- 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 86e790a14312..da95ed30c203 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,7 +33,7 @@ jobs: run: pnpm run lint changed: - runs-on: macos-14 + runs-on: ubuntu-latest outputs: should_skip: ${{ steps.changed-files.outputs.only_changed == 'true' }} @@ -50,6 +50,25 @@ jobs: !.github/workflows/ci.yml **.md + typecheck: + needs: changed + if: needs.changed.outputs.should_skip != 'true' + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - uses: ./.github/actions/setup-and-cache + + - name: Install + run: pnpm i + + - name: Build + run: pnpm run build + + - name: Typecheck + run: pnpm run typecheck + test: needs: changed if: needs.changed.outputs.should_skip != 'true' diff --git a/packages/browser/src/client/tester/unhandled.ts b/packages/browser/src/client/tester/unhandled.ts index 8d9123ed6ba2..3ddd5cd57896 100644 --- a/packages/browser/src/client/tester/unhandled.ts +++ b/packages/browser/src/client/tester/unhandled.ts @@ -33,7 +33,7 @@ function catchWindowErrors(cb: (e: ErrorEvent) => void) { const removeEventListener = window.removeEventListener.bind(window) window.addEventListener('error', throwUnhandlerError) window.addEventListener = function ( - ...args: Parameters + ...args: [any, any, any] ) { if (args[0] === 'error') { userErrorListenerCount++ @@ -41,7 +41,7 @@ function catchWindowErrors(cb: (e: ErrorEvent) => void) { return addEventListener.apply(this, args) } window.removeEventListener = function ( - ...args: Parameters + ...args: [any, any, any] ) { if (args[0] === 'error' && userErrorListenerCount) { userErrorListenerCount-- diff --git a/packages/vitest/src/integrations/env/jsdom.ts b/packages/vitest/src/integrations/env/jsdom.ts index c772d270813b..c1d6c181ace9 100644 --- a/packages/vitest/src/integrations/env/jsdom.ts +++ b/packages/vitest/src/integrations/env/jsdom.ts @@ -12,7 +12,7 @@ function catchWindowErrors(window: Window) { const removeEventListener = window.removeEventListener.bind(window) window.addEventListener('error', throwUnhandlerError) window.addEventListener = function ( - ...args: Parameters + ...args: [any, any, any] ) { if (args[0] === 'error') { userErrorListenerCount++ @@ -20,7 +20,7 @@ function catchWindowErrors(window: Window) { return addEventListener.apply(this, args) } window.removeEventListener = function ( - ...args: Parameters + ...args: [any, any, any] ) { if (args[0] === 'error' && userErrorListenerCount) { userErrorListenerCount--