Skip to content

Commit 49baffc

Browse files
committed
test: add dts tests
1 parent 5c2606f commit 49baffc

10 files changed

Lines changed: 86 additions & 2 deletions

File tree

pnpm-lock.yaml

Lines changed: 19 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
File renamed without changes.

test/cli/dts/exact-optional-property/src/runner.ts renamed to test/cli/dts/exact-optional-property-no-node/src/runner.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
import type { VitestRunner } from '@vitest/runner'
2+
import type { FailureScreenshotArtifact } from '@vitest/runner/types'
23
import { VitestTestRunner } from 'vitest/runners'
34

5+
type _Override = FailureScreenshotArtifact
6+
47
export class MyRunner extends VitestTestRunner implements VitestRunner {}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"extends": ["../_shared/tsconfig.patch.json"],
3+
"compilerOptions": {
4+
"target": "ESNext",
5+
"module": "ESNext",
6+
"moduleResolution": "Bundler",
7+
"types": [],
8+
"strict": true,
9+
"exactOptionalPropertyTypes": true,
10+
"declaration": true,
11+
"declarationMap": true,
12+
"outDir": "dist",
13+
"sourceMap": true,
14+
"verbatimModuleSyntax": true,
15+
"skipLibCheck": false
16+
}
17+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"name": "@vitest/test-integration-dts-exact-optional-property",
3+
"type": "module",
4+
"private": true,
5+
"scripts": {
6+
"test": "tsc -b"
7+
},
8+
"devDependencies": {
9+
"@vitest/runner": "workspace:*",
10+
"vitest": "workspace:*"
11+
}
12+
}

test/cli/dts/exact-optional-property/src/reporter.ts renamed to test/cli/dts/exact-optional-property-node/src/reporter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { File } from '@vitest/runner'
2-
import { DefaultReporter } from 'vitest/reporters'
2+
import { DefaultReporter } from 'vitest/node'
33

44
export class MyReporter extends DefaultReporter {
55
override reportTestSummary(files: File[], errors: unknown[], leakCount: number): void {

test/cli/dts/exact-optional-property/tsconfig.json renamed to test/cli/dts/exact-optional-property-node/tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"target": "ESNext",
55
"module": "ESNext",
66
"moduleResolution": "Bundler",
7+
"types": [],
78
"strict": true,
89
"exactOptionalPropertyTypes": true,
910
"declaration": true,
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"name": "@vitest/test-integration-dts-exact-optional-property",
3+
"type": "module",
4+
"private": true,
5+
"scripts": {
6+
"test": "tsc -b"
7+
},
8+
"devDependencies": {
9+
"@vitest/runner": "workspace:*",
10+
"vitest": "workspace:*"
11+
}
12+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { vi } from 'vitest'
2+
3+
const _fn = vi.fn()
4+
const _mock = vi.doMock('./vitest.ts')
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"extends": ["../_shared/tsconfig.patch.json"],
3+
"compilerOptions": {
4+
"target": "es2020",
5+
"lib": ["DOM", "ES2020"],
6+
"module": "node16",
7+
"types": [],
8+
"strict": true,
9+
"declaration": true,
10+
"declarationMap": true,
11+
"outDir": "dist",
12+
"sourceMap": true,
13+
"verbatimModuleSyntax": true,
14+
"skipLibCheck": false
15+
},
16+
"include": ["src/*.ts"]
17+
}

0 commit comments

Comments
 (0)