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 · API reference · all subjects

testattachment

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

TestAttachment interface fields

TestAttachment interface has the following properties: contentType (optional string, MIME type like 'image/png' or 'text/plain'), path (optional string, local file path or external HTTP(S) URL, relative paths resolved from project root), body (optional string or Uint8Array, inline attachment content), and bodyEncoding (optional 'base64' | 'utf-8', how the string body is encoded, defaults to 'base64', only applies to inline body attachments not path attachments).

TestAttachment path behavior

TestAttachment path can point to a local file or an external http/https URL. Relative local paths are resolved from the project root. Local files are copied into Vitest's attachments directory before reporters receive them. External URLs are preserved as-is.

TestAttachment body encoding rules

If TestAttachment body is passed as a string, Vitest assumes it is already base64-encoded unless bodyEncoding: 'utf-8' is set. When body is passed as a Uint8Array, Vitest automatically encodes it as base64. The bodyEncoding option only applies to inline body attachments, not path attachments.

Give your agent this brain