This commit is contained in:
2025-09-08 13:22:48 +03:00
commit a92aa1ed6c
20 changed files with 2153 additions and 0 deletions

29
src/repl.test.ts Normal file
View File

@@ -0,0 +1,29 @@
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]);
}
});
});