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 · Guide · all subjects

test context

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

Test Context second argument provides utilities in parameterized tests

The second argument to the test function is the Test Context, which gives access to fixtures, per-test expect, and other utilities. This is especially useful with test.concurrent where concurrent tests run in parallel and global expect cannot reliably associate a snapshot with the right test.

Example: concurrent parameterized test with context expect

test.concurrent.for([ [1, 1], [1, 2], [2, 1], ])('add(%i, %i)', ([a, b], { expect }) => { expect(a + b).toMatchSnapshot() })

Give your agent this brain