Skip to content

Commit 974686e

Browse files
committed
test: add dts-playwright
1 parent da709f8 commit 974686e

File tree

5 files changed

+39
-0
lines changed

5 files changed

+39
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,4 @@ test/**/__screenshots__/**/*
2828
test/browser/fixtures/update-snapshot/basic.test.ts
2929
test/cli/fixtures/browser-multiple/basic-*
3030
.vitest-reports
31+
*.tsbuildinfo

pnpm-lock.yaml

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/dts-playwright/package.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"name": "@vitest/test-dts-fixture",
3+
"type": "module",
4+
"private": true,
5+
"scripts": {
6+
"test": "tsc -b"
7+
},
8+
"devDependencies": {
9+
"@vitest/browser": "workspace:*",
10+
"vitest": "workspace:*"
11+
}
12+
}

test/dts-playwright/src/basic.test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/// <reference types="@vitest/browser/providers/playwright" />
2+
import { test } from 'vitest'
3+
import { userEvent, page } from "@vitest/browser/context"
4+
5+
test("basic", async () => {
6+
document.body.innerHTML = `<button>hello</button>`;
7+
await userEvent.click(page.getByRole('button'), { force: true });
8+
})

test/dts-playwright/tsconfig.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"compilerOptions": {
3+
"noEmit": true,
4+
"target": "ESNext",
5+
"module": "ESNext",
6+
"moduleResolution": "Bundler"
7+
},
8+
"include": ["src"]
9+
}

0 commit comments

Comments
 (0)