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

Bun · Test runner · all subjects

test/coverage

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

coverageSkipTestFiles to exclude test files from coverage

Set coverageSkipTestFiles = true to exclude files matching test patterns (for example *.test.ts) from the coverage report.

Basic coverage settings

Configure coverage with three options: coverage = true enables coverage by default, coverageReporter = [list] sets coverage reporter types (e.g., ['text', 'lcov']), and coverageDir = 'path' sets coverage output directory.

coverageThreshold simple and detailed formats

Specify coverage threshold as either a single number (applies to lines, functions, and statements) or as an object with per-metric thresholds: coverageThreshold = { lines = 0.9, functions = 0.8, statements = 0.85 }. Setting any of these enables fail_on_low_coverage, causing the test run to fail if coverage is below the threshold.

coveragePathIgnorePatterns for coverage exclusions

The coveragePathIgnorePatterns option excludes specific files or file patterns from coverage reports using glob patterns. It accepts a single pattern string or a list of patterns. Files matching any pattern are excluded from coverage calculation and reporting.

coverageIgnoreSourcemaps option behavior

Set coverageIgnoreSourcemaps = true to opt out of using sourcemaps for coverage analysis. Normally Bun transpiles every file and coverage results pass through sourcemaps before reporting. When using this option, the results can be confusing because during transpilation Bun may move code around and rename variables. The option is mostly useful for debugging coverage issues. Consider using a // @bun comment at the top of source files to opt out of transpilation when using this option.

Give your agent this brain