Files
scriptc/tests/fixtures/node-test/cases/ctx-surface.ts
2026-07-22 18:08:04 -05:00

24 lines
634 B
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// The TestContext surface: t.name reads the test's own name, t.diagnostic
// queues ℹ lines after the result line, and t.skip/t.todo mark the
// RUNNING test (the body keeps executing — skipped-by-t.skip counts
// skipped even though it ran).
import assert from "node:assert";
import { test } from "node:test";
test("knows its name", (t) => {
assert.strictEqual(t.name, "knows its name");
});
test("emits diagnostics", (t) => {
t.diagnostic("first note");
t.diagnostic("second note");
});
test("skips itself", (t) => {
t.skip("decided at runtime");
});
test("todos itself", (t) => {
t.todo("revisit this one");
});