[READ-ONLY] Mirror of https://github.com/vitest-dev/vitest. Next generation testing framework powered by Vite. vitest.dev
test testing-tools vite
12

Configure Feed

Select the types of activity you want to include in your feed.

test: each test case for browser (#3100)

authored by

Mohammad Bagher Abiat and committed by
GitHub
(Apr 8, 2023, 1:53 PM +0200) ddbda102 430b4ecb

+47 -2
+2 -2
package.json
··· 29 29 "ui:build": "vite build packages/ui", 30 30 "ui:dev": "vite packages/ui", 31 31 "ui:test": "npm -C packages/ui run test:run", 32 - "test:browser:webdriverio": "npm -C test/browser run test:webdriverio", 33 - "test:browser:playwright": "npm -C test/browser run test:playwright" 32 + "test:browser:webdriverio": "pnpm -C test/browser run test:webdriverio", 33 + "test:browser:playwright": "pnpm -C test/browser run test:playwright" 34 34 }, 35 35 "devDependencies": { 36 36 "@antfu/eslint-config": "^0.38.4",
+37
.github/workflows/ci.yml
··· 140 140 env: 141 141 BROWSER: ${{ matrix.browser[1] }} 142 142 143 + test-browser-windows: 144 + runs-on: windows-latest 145 + strategy: 146 + matrix: 147 + browser: [[chrome, chromium], [edge, webkit]] 148 + 149 + timeout-minutes: 10 150 + 151 + env: 152 + BROWSER: ${{ matrix.browser[0] }} 153 + steps: 154 + - uses: actions/checkout@v3 155 + 156 + - uses: ./.github/actions/setup-and-cache 157 + with: 158 + node-version: 18 159 + 160 + - uses: browser-actions/setup-chrome@v1 161 + - uses: browser-actions/setup-edge@v1 162 + 163 + - name: Install 164 + run: pnpm i 165 + 166 + - name: Install Playwright Dependencies 167 + run: pnpx playwright install-deps 168 + 169 + - name: Build 170 + run: pnpm run build 171 + 172 + - name: Test Browser (webdriverio) 173 + run: pnpm run test:browser:webdriverio 174 + 175 + - name: Test Browser (playwright) 176 + run: pnpm run test:browser:playwright 177 + env: 178 + BROWSER: ${{ matrix.browser[1] }} 179 + 143 180 test-browser-safari: 144 181 runs-on: macos-latest 145 182 timeout-minutes: 10
+7
test/browser/test/basic.test.ts
··· 7 7 it('basic 2', () => { 8 8 expect(globalThis.window).toBeDefined() 9 9 }) 10 + 11 + it.each([ 12 + ['x', true], 13 + ['y', false], 14 + ])('%s is x', (val, expectedResult) => { 15 + expect(val === 'x').toBe(expectedResult) 16 + })
+1
packages/vitest/src/integrations/browser/server.ts
··· 42 42 } 43 43 44 44 config.server = server 45 + config.server.fs = { strict: false } 45 46 46 47 config.optimizeDeps ??= {} 47 48 config.optimizeDeps.entries ??= []