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

16 lines
400 B
TypeScript

// @exit: 1
// Sync bodies: passes report ✔, a throwing body reports ✖, lands in the
// failing-tests section with its message, and fails the process.
import { test } from "node:test";
test("first passes", () => {
const x = 2 + 2;
if (x !== 4) throw new Error("math broke");
});
test("second fails", () => {
throw new Error("deliberate failure");
});
test("third still runs", () => {});