init
This commit is contained in:
29
src/repl.test.ts
Normal file
29
src/repl.test.ts
Normal 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]);
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user