mirror of
https://github.com/hanzoai/vitest.git
synced 2026-09-24 17:04:25 +00:00
18 lines
510 B
TypeScript
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]`)
|
|
});
|