diff --git a/packages/runner/src/types/runner.ts b/packages/runner/src/types/runner.ts index e5b66b463be6..edecb67bfbba 100644 --- a/packages/runner/src/types/runner.ts +++ b/packages/runner/src/types/runner.ts @@ -22,10 +22,10 @@ import type { export interface VitestRunnerConfig { root: string setupFiles: string[] - name?: string + name: string | undefined passWithNoTests: boolean - testNamePattern?: RegExp - allowOnly?: boolean + testNamePattern: RegExp | undefined + allowOnly: boolean sequence: { shuffle?: boolean concurrent?: boolean @@ -33,17 +33,17 @@ export interface VitestRunnerConfig { hooks: SequenceHooks setupFiles: SequenceSetupFiles } - chaiConfig?: { + chaiConfig: { truncateThreshold?: number - } + } | undefined maxConcurrency: number testTimeout: number hookTimeout: number retry: SerializableRetry - includeTaskLocation?: boolean + includeTaskLocation: boolean | undefined diffOptions?: DiffOptions tags: TestTagDefinition[] - tagsFilter?: string[] + tagsFilter: string[] | undefined strictTags: boolean } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index aef360c5d8da..6201105c9113 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1315,6 +1315,15 @@ importers: specifier: workspace:* version: link:../../../../packages/vitest + test/cli/dts/exact-optional-property: + devDependencies: + '@vitest/runner': + specifier: workspace:* + version: link:../../../../packages/runner + vitest: + specifier: workspace:* + version: link:../../../../packages/vitest + test/cli/dts/fixture-extend: devDependencies: vitest: diff --git a/test/cli/dts/exact-optional-property/package.json b/test/cli/dts/exact-optional-property/package.json new file mode 100644 index 000000000000..51c24416b172 --- /dev/null +++ b/test/cli/dts/exact-optional-property/package.json @@ -0,0 +1,12 @@ +{ + "name": "@vitest/test-integration-dts-exact-optional-property", + "type": "module", + "private": true, + "scripts": { + "test": "tsc -b" + }, + "devDependencies": { + "@vitest/runner": "workspace:*", + "vitest": "workspace:*" + } +} diff --git a/test/cli/dts/exact-optional-property/src/reporter.ts b/test/cli/dts/exact-optional-property/src/reporter.ts new file mode 100644 index 000000000000..a0b76ae951ec --- /dev/null +++ b/test/cli/dts/exact-optional-property/src/reporter.ts @@ -0,0 +1,8 @@ +import type { File } from '@vitest/runner' +import { DefaultReporter } from 'vitest/reporters' + +export class MyReporter extends DefaultReporter { + override reportTestSummary(files: File[], errors: unknown[], leakCount: number): void { + super.reportTestSummary(files, errors, leakCount) + } +} diff --git a/test/cli/dts/exact-optional-property/src/runner.ts b/test/cli/dts/exact-optional-property/src/runner.ts new file mode 100644 index 000000000000..da41cb84a9f5 --- /dev/null +++ b/test/cli/dts/exact-optional-property/src/runner.ts @@ -0,0 +1,4 @@ +import type { VitestRunner } from '@vitest/runner' +import { VitestTestRunner } from 'vitest/runners' + +export class MyRunner extends VitestTestRunner implements VitestRunner {} diff --git a/test/cli/dts/exact-optional-property/tsconfig.json b/test/cli/dts/exact-optional-property/tsconfig.json new file mode 100644 index 000000000000..f41906c5b6a2 --- /dev/null +++ b/test/cli/dts/exact-optional-property/tsconfig.json @@ -0,0 +1,16 @@ +{ + "extends": ["../_shared/tsconfig.patch.json"], + "compilerOptions": { + "target": "ESNext", + "module": "ESNext", + "moduleResolution": "Bundler", + "strict": true, + "exactOptionalPropertyTypes": true, + "declaration": true, + "declarationMap": true, + "outDir": "dist", + "sourceMap": true, + "verbatimModuleSyntax": true, + "skipLibCheck": true + } +}