Skip to content

Commit 4e60333

Browse files
authored
fix(benchmark): disable type testing while benchmarking (#7068)
1 parent 8a6f5f1 commit 4e60333

File tree

4 files changed

+12
-0
lines changed

4 files changed

+12
-0
lines changed

packages/vitest/src/node/config/resolveConfig.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -557,6 +557,7 @@ export function resolveConfig(
557557
}
558558
// override test config
559559
resolved.coverage.enabled = false
560+
resolved.typecheck.enabled = false
560561
resolved.include = resolved.benchmark.include
561562
resolved.exclude = resolved.benchmark.exclude
562563
resolved.includeSource = resolved.benchmark.includeSource
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { describe, expectTypeOf, test } from 'vitest'
2+
3+
describe('test', () => {
4+
test('some-test', () => {
5+
expectTypeOf({ a: 1 }).toEqualTypeOf({ a: "should not match" })
6+
})
7+
})

test/benchmark/test/basic.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ it('basic', { timeout: 60_000 }, async () => {
1313
root,
1414
allowOnly: true,
1515
outputJson: 'bench.json',
16+
17+
// Verify that type testing cannot be used with benchmark
18+
typecheck: { enabled: true },
1619
}, [], 'benchmark')
1720
expect(result.exitCode).toBe(0)
1821

tsconfig.check.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"./packages/ui/client/**",
1515
"./examples/**/*.*",
1616
"./bench/**",
17+
"./test/benchmark/fixtures/**",
1718
"./test/typescript/**",
1819
"./test/browser/**",
1920
"**/coverage/fixtures/**",

0 commit comments

Comments
 (0)