mirror of
https://github.com/vitest-dev/vitest.git
synced 2025-12-08 18:26:03 +00:00
test: each test case for browser (#3100)
This commit is contained in:
parent
430b4ecbab
commit
ddbda102d3
37
.github/workflows/ci.yml
vendored
37
.github/workflows/ci.yml
vendored
@ -140,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
|
||||
|
||||
@ -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.38.4",
|
||||
|
||||
@ -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 ??= []
|
||||
|
||||
@ -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)
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user