From 8fcdf542db3e5de3065e8a5cdbeb8a9c6c715eb8 Mon Sep 17 00:00:00 2001 From: "M. Bagher Abiat" Date: Wed, 29 Mar 2023 17:06:37 +0330 Subject: [PATCH 1/7] test to see if fails in windows --- test/browser/test/basic.test.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/browser/test/basic.test.ts b/test/browser/test/basic.test.ts index 6f7a12cdec04..39071edc652b 100644 --- a/test/browser/test/basic.test.ts +++ b/test/browser/test/basic.test.ts @@ -7,3 +7,10 @@ it('basic', async () => { it('basic 2', () => { expect(globalThis.window).toBeDefined() }) + +it.each([ + ['x', true], + ['y', false], +])('%s is x', (val, expectedResult) => { + expect(val === 'x').toBe(expectedResult) +}) From 794abb8c52955112d5971e8f1d40d1a898bd5e1b Mon Sep 17 00:00:00 2001 From: "M. Bagher Abiat" Date: Wed, 29 Mar 2023 17:30:08 +0330 Subject: [PATCH 2/7] add windows to browser tests in ci --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 707d6c2ff727..b74fd1a37676 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -103,9 +103,10 @@ jobs: run: pnpm run ui:test test-browser: - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} strategy: matrix: + os: [ubuntu-latest, windows-latest] browser: [[chrome, chromium], [firefox, firefox], [edge, webkit]] timeout-minutes: 10 From 37d24838365b2e6546b30cfd6df6b806839ee30e Mon Sep 17 00:00:00 2001 From: "M. Bagher Abiat" Date: Wed, 29 Mar 2023 18:24:02 +0330 Subject: [PATCH 3/7] add windows to browser tests in ci --- .github/workflows/ci.yml | 40 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b74fd1a37676..b8741ad129c1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -103,10 +103,9 @@ jobs: run: pnpm run ui:test test-browser: - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest strategy: matrix: - os: [ubuntu-latest, windows-latest] browser: [[chrome, chromium], [firefox, firefox], [edge, webkit]] timeout-minutes: 10 @@ -141,6 +140,43 @@ jobs: env: BROWSER: ${{ matrix.browser[1] }} + test-browser-windows: + runs-on: windows-latest + strategy: + matrix: + browser: [[chrome, chromium], [edge, webkit]] + + timeout-minutes: 10 + + env: + BROWSER: ${{ matrix.browser[0] }} + steps: + - uses: actions/checkout@v3 + + - uses: ./.github/actions/setup-and-cache + with: + node-version: 18 + + - uses: browser-actions/setup-chrome@v1 + - uses: browser-actions/setup-edge@v1 + + - name: Install + run: pnpm i + + - name: Install Playwright Dependencies + run: pnpx playwright install-deps + + - name: Build + run: pnpm run build + + - name: Test Browser (webdriverio) + run: pnpm run test:browser:webdriverio + + - name: Test Browser (playwright) + run: pnpm run test:browser:playwright + env: + BROWSER: ${{ matrix.browser[1] }} + test-browser-safari: runs-on: macos-latest timeout-minutes: 10 From 52210ea7978923ead75bee7015c0bee149c84a0c Mon Sep 17 00:00:00 2001 From: "M. Bagher Abiat" Date: Tue, 4 Apr 2023 02:04:51 +0330 Subject: [PATCH 4/7] add cross-env --- pnpm-lock.yaml | 10 ++++++++++ test/browser/package.json | 5 +++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f12f8423ce33..203292a4e412 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1015,11 +1015,13 @@ importers: test/browser: specifiers: '@vitest/browser': workspace:* + cross-env: ^7.0.3 execa: ^7.1.1 safaridriver: ^0.0.4 vitest: workspace:* devDependencies: '@vitest/browser': link:../../packages/browser + cross-env: 7.0.3 execa: 7.1.1 safaridriver: 0.0.4 vitest: link:../../packages/vitest @@ -11370,6 +11372,14 @@ packages: resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==} dev: true + /cross-env/7.0.3: + resolution: {integrity: sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==} + engines: {node: '>=10.14', npm: '>=6', yarn: '>=1'} + hasBin: true + dependencies: + cross-spawn: 7.0.3 + dev: true + /cross-fetch/3.1.5: resolution: {integrity: sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw==} dependencies: diff --git a/test/browser/package.json b/test/browser/package.json index c2477b82c80f..9cf517d6f622 100644 --- a/test/browser/package.json +++ b/test/browser/package.json @@ -4,12 +4,13 @@ "module": "true", "scripts": { "test": "pnpm run test:webdriverio && pnpm run test:playwright", - "test:webdriverio": "PROVIDER=webdriverio node --test specs/", - "test:playwright": "PROVIDER=playwright node --test specs/", + "test:webdriverio": "cross-env PROVIDER=webdriverio node --test specs/", + "test:playwright": "cross-env PROVIDER=playwright node --test specs/", "coverage": "vitest --coverage.enabled --coverage.provider=istanbul" }, "devDependencies": { "@vitest/browser": "workspace:*", + "cross-env": "^7.0.3", "execa": "^7.1.1", "safaridriver": "^0.0.4", "vitest": "workspace:*" From c018a4029a0172c4fbc260e7e7bb548672d67b91 Mon Sep 17 00:00:00 2001 From: "M. Bagher Abiat" Date: Thu, 6 Apr 2023 06:57:25 +0330 Subject: [PATCH 5/7] strict to false so users can access files like vitest/utils --- packages/vitest/src/integrations/browser/server.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/vitest/src/integrations/browser/server.ts b/packages/vitest/src/integrations/browser/server.ts index 61ef7bad1967..67ebd48f772f 100644 --- a/packages/vitest/src/integrations/browser/server.ts +++ b/packages/vitest/src/integrations/browser/server.ts @@ -42,6 +42,7 @@ export async function createBrowserServer(ctx: Vitest, options: UserConfig) { } config.server = server + config.server.fs = { strict: false } config.optimizeDeps ??= {} config.optimizeDeps.entries ??= [] From 8fcb51283a41c20c19d40923d2e115e77538c081 Mon Sep 17 00:00:00 2001 From: "M. Bagher Abiat" Date: Thu, 6 Apr 2023 07:50:52 +0330 Subject: [PATCH 6/7] attempt to fix ci --- package.json | 4 ++-- test/browser/package.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 056d0c2298e6..6b525bc07689 100644 --- a/package.json +++ b/package.json @@ -29,8 +29,8 @@ "ui:build": "vite build packages/ui", "ui:dev": "vite packages/ui", "ui:test": "npm -C packages/ui run test:run", - "test:browser:webdriverio": "npm -C test/browser run test:webdriverio", - "test:browser:playwright": "npm -C test/browser run test:playwright" + "test:browser:webdriverio": "pnpm -C test/browser run test:webdriverio", + "test:browser:playwright": "pnpm -C test/browser run test:playwright" }, "devDependencies": { "@antfu/eslint-config": "^0.34.1", diff --git a/test/browser/package.json b/test/browser/package.json index 9cf517d6f622..2b175d334d20 100644 --- a/test/browser/package.json +++ b/test/browser/package.json @@ -4,8 +4,8 @@ "module": "true", "scripts": { "test": "pnpm run test:webdriverio && pnpm run test:playwright", - "test:webdriverio": "cross-env PROVIDER=webdriverio node --test specs/", - "test:playwright": "cross-env PROVIDER=playwright node --test specs/", + "test:webdriverio": "PROVIDER=webdriverio node --test specs/", + "test:playwright": "PROVIDER=playwright node --test specs/", "coverage": "vitest --coverage.enabled --coverage.provider=istanbul" }, "devDependencies": { From 606aa0ae7cc01eac107fb836f8ea26152ff9b733 Mon Sep 17 00:00:00 2001 From: "M. Bagher Abiat" Date: Thu, 6 Apr 2023 08:45:00 +0330 Subject: [PATCH 7/7] attempt to fix ci --- pnpm-lock.yaml | 10 ---------- test/browser/package.json | 1 - 2 files changed, 11 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 203292a4e412..f12f8423ce33 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1015,13 +1015,11 @@ importers: test/browser: specifiers: '@vitest/browser': workspace:* - cross-env: ^7.0.3 execa: ^7.1.1 safaridriver: ^0.0.4 vitest: workspace:* devDependencies: '@vitest/browser': link:../../packages/browser - cross-env: 7.0.3 execa: 7.1.1 safaridriver: 0.0.4 vitest: link:../../packages/vitest @@ -11372,14 +11370,6 @@ packages: resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==} dev: true - /cross-env/7.0.3: - resolution: {integrity: sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==} - engines: {node: '>=10.14', npm: '>=6', yarn: '>=1'} - hasBin: true - dependencies: - cross-spawn: 7.0.3 - dev: true - /cross-fetch/3.1.5: resolution: {integrity: sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw==} dependencies: diff --git a/test/browser/package.json b/test/browser/package.json index 2b175d334d20..c2477b82c80f 100644 --- a/test/browser/package.json +++ b/test/browser/package.json @@ -10,7 +10,6 @@ }, "devDependencies": { "@vitest/browser": "workspace:*", - "cross-env": "^7.0.3", "execa": "^7.1.1", "safaridriver": "^0.0.4", "vitest": "workspace:*"