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

Deno · Reference · all subjects

vscode/testing

4 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 code lens in VS Code

The Deno extension provides a code lens above test blocks that displays "▶ Run Test". Clicking this lens runs the test using the Deno CLI and displays the output in the editor. The extension tracks destructuring of Deno.test or variable assignments, so renamed test functions still trigger the code lens.

Running tests from VS Code

Tests can be run from the Test Explorer view, from code lens decorations, or via the command palette. The Test Explorer view has a filter function to exclude certain tests from a test run. When a test fails, the failure message and stack trace are available in the test results.

Test code lens example

When you have a Deno.test block in code, you can click the code lens above it to run the test. Example: a test defined with Deno.test({ name: "a test case", fn() { ... } }) displays a code lens above it.

Deno test tracking renamed functions

The extension can track if Deno.test is destructured or assigned to a variable, allowing code lenses to work with renamed test functions. Example: const { test: denoTest } = Deno; denoTest({ name: "example test", fn() {} }); will still trigger the code lens.

Give your agent this brain