Skip to content

Commit

Permalink
fix(benchmark): disable type testing while benchmarking (#7068)
Browse files Browse the repository at this point in the history
  • Loading branch information
AriPerkkio authored Dec 11, 2024
1 parent 8a6f5f1 commit 4e60333
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/vitest/src/node/config/resolveConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,7 @@ export function resolveConfig(
}
// override test config
resolved.coverage.enabled = false
resolved.typecheck.enabled = false
resolved.include = resolved.benchmark.include
resolved.exclude = resolved.benchmark.exclude
resolved.includeSource = resolved.benchmark.includeSource
Expand Down
7 changes: 7 additions & 0 deletions test/benchmark/fixtures/basic/should-not-run.test-d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { describe, expectTypeOf, test } from 'vitest'

describe('test', () => {
test('some-test', () => {
expectTypeOf({ a: 1 }).toEqualTypeOf({ a: "should not match" })
})
})
3 changes: 3 additions & 0 deletions test/benchmark/test/basic.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ it('basic', { timeout: 60_000 }, async () => {
root,
allowOnly: true,
outputJson: 'bench.json',

// Verify that type testing cannot be used with benchmark
typecheck: { enabled: true },
}, [], 'benchmark')
expect(result.exitCode).toBe(0)

Expand Down
1 change: 1 addition & 0 deletions tsconfig.check.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"./packages/ui/client/**",
"./examples/**/*.*",
"./bench/**",
"./test/benchmark/fixtures/**",
"./test/typescript/**",
"./test/browser/**",
"**/coverage/fixtures/**",
Expand Down

0 comments on commit 4e60333

Please sign in to comment.