Files
boot-dev-pokedex-typescript/src/repl.test.ts
2025-09-08 13:22:48 +03:00

30 lines
627 B
TypeScript

import { cleanInput } from "./repl.js";
import { describe, expect, test } from "vitest";
describe.each([
{
input: " ",
expected: [],
},
{
input: " hello ",
expected: ["hello"],
},
{
input: " hello world ",
expected: ["hello", "world"],
},
{
input: " HellO World ",
expected: ["hello", "world"],
},
])("cleanInput($input)", ({ input, expected }) => {
test(`Expected: ${expected}`, () => {
const actual = cleanInput(input);
expect(actual).toHaveLength(expected.length);
for (const i in expected) {
expect(actual[i]).toBe(expected[i]);
}
});
});