Skip to content

Commit 1dde33d

Browse files
committed
fix(benchmark): disable type testing while benchmarking
1 parent 8a6f5f1 commit 1dde33d

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-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

0 commit comments

Comments
 (0)