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 organization

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

Organize tests into groups with describe blocks

The documentation references describe blocks for test organization in the tracking issue and Jest compatibility context, indicating Bun supports describe() for grouping tests, though the primary index page does not show the full syntax.

Run parametrized tests with different inputs

Bun supports parametrized tests using chaining qualifiers such as `test.failing.each()`. Example: `test.failing.each([1, 2, 3])("chained qualifiers %d", input => { expect(input).toBe(0); });` runs the test for each input value.

Run parametrized suites with describe.each

Bun supports `describe.each()` for running parametrized test suites with different inputs, similar to Jest's describe.each API.

Organize tests into groups using describe blocks

Use `describe()` to group related tests into suites. The function takes a suite name and a callback containing nested tests. All tests within a describe block are grouped together in output.

Conditional modifiers on describe blocks

The conditional modifiers `.if()`, `.skipIf()`, and `.todoIf()` work on `describe` blocks, affecting all tests in the suite.

describe.each for parametrized suites

Use `describe.each()` to create a parametrized suite that runs once for each test case. Multiple tests within the describe block will run for each test case.

Give your agent this brain