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

hooks & setup-teardown

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

sequence.hooks flag changes hook execution order

The `--sequence.hooks <order>` CLI flag changes hook execution order. Accepted values: "stack", "list", and "parallel". Default is "parallel".

teardownTimeout flag sets teardown timeout

The `--teardownTimeout <timeout>` CLI flag sets the default timeout of a teardown function in milliseconds. Default is `10000`.

sequence.setupFiles flag changes setup file order

The `--sequence.setupFiles <order>` CLI flag changes setup file execution order. Accepted values: "list" and "parallel". "list" runs setup files in defined order; "parallel" runs them concurrently. Default is "parallel".

hookTimeout flag sets hook timeout

The `--hookTimeout <timeout>` CLI flag sets the default hook timeout in milliseconds. Default is `10000`. Use `0` to disable timeout.

Hooks teardown functions in Vitest

In Vitest, beforeAll and beforeEach hooks may return a teardown function. If your hooks return something other than undefined or null and don't intend it as a teardown function, wrap the code in braces.

sequence.hooks option for hook execution order

In Vitest, hooks run in a stack by default. To run them sequentially one after another like Jest does, set sequence.hooks: 'list' in the test configuration.

Mocha beforeAll/afterAll hooks in Vitest

Vitest supports Mocha's hook structure. Import beforeAll, afterAll, beforeEach, afterEach, describe, it from vitest. They work the same as Mocha.

Give your agent this brain