new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Vitest · Config reference · all subjects

config/benchmark

8 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

benchmark.enabled option type and default

The benchmark.enabled option has type boolean with a default value of false. When set to true, Vitest creates a dedicated benchmark project alongside your regular test project, runs files matching benchmark.include in it, and exposes the bench fixture to those files. Running vitest bench enables this automatically.

benchmark.include option type and default

The benchmark.include option has type string[] with a default value of ['**/*.{bench,benchmark}.?(c|m)[jt]s?(x)'] and specifies include globs for benchmark test files.

benchmark.exclude option type and default

The benchmark.exclude option has type string[] with a default value of ['node_modules', 'dist', '.idea', '.git', '.cache'] and specifies exclude globs for benchmark test files.

benchmark.includeSource option type and default

The benchmark.includeSource option has type string[] with a default value of [] and specifies include globs for in-source benchmark test files. This option is similar to includeSource. When defined, Vitest will run all matched files with import.meta.vitest inside.

benchmark.retainSamples option type and default

The benchmark.retainSamples option has type boolean with a default value of false. When enabled, it includes the samples array of per-iteration timings on every benchmark result. It is disabled by default to reduce memory usage; enable when a custom reporter or API consumer needs the raw samples.

benchmark.suppressExportGetterWarnings option type and default

The benchmark.suppressExportGetterWarnings option has type boolean with a default value of false. When enabled, it suppresses the warning printed when a benchmark accesses module export getters too many times. Vitest tracks getter access during benchmark runs because Vite's module runner wraps every export in a getter, and excessive access can dominate the measurement. Enable this when you've intentionally accepted the overhead, or when the warning is noisy for benchmarks where the getter cost is negligible.

benchmark.provider config option type and default

The benchmark.provider option is set to a path string pointing to a provider module. Relative paths are resolved from the project root. The module must have a default export with an object that implements the BenchmarkProvider interface. There is no mentioned default value; it must be explicitly configured to use a custom provider.

BenchmarkProvider interface run method signature

The BenchmarkProvider must implement a run method with the signature: async run({ test, config, registrations, options }). The test parameter is the test that registered the benchmarks, with test.context.signal being an AbortSignal. The config parameter is the resolved benchmark configuration. The registrations parameter is an array of runnable benchmarks, each containing name, fn, and optional fnOpts properties. The options parameter contains benchmark run options passed to .run() or bench.compare(). The method must resolve to an array of BenchResult objects, one for every runnable registration, matched by name.

Give your agent this brain