Files
2026-05-11 17:46:13 +02:00

18 lines
510 B
TypeScript

import { expect, test, describe } from "vitest";
test.for(["hello", "world"])("test %s", (arg) => {
expect(arg.length).toMatchInlineSnapshot(`5`);
});
describe.for(["hello", "world"])("suite %s", (arg) => {
test("length", () => {
expect(arg.length).toMatchInlineSnapshot(`5`);
});
});
test.for(["hello", "world"])("toThrowErrorMatchingInlineSnapshot %s", (arg) => {
expect(() => {
throw new Error(`length = ${arg.length}`);
}).toThrowErrorMatchingInlineSnapshot(`[Error: length = 5]`)
});