Botanique/tests/modules/string.test.ts

37 lines
715 B
TypeScript
Raw Normal View History

2024-12-10 10:24:55 +01:00
import "../../src/modules/string";
2024-12-10 10:04:15 +01:00
import { describe, it } from "node:test";
import assert from "node:assert/strict";
describe("Capitalize", () => {
{
const name = "test";
2024-12-10 10:04:15 +01:00
it(name, () => {
assert.strictEqual(name.capitalize(), "Test");
});
}
{
const name = "MACHIN";
2024-12-10 10:04:15 +01:00
it(name, () => {
assert.strictEqual(name.capitalize(), "MACHIN");
});
}
{
const name = "tRUC";
2024-12-10 10:04:15 +01:00
it(name, () => {
assert.strictEqual(name.capitalize(), "TRUC");
});
}
{
const name = "Super";
2024-12-10 10:04:15 +01:00
it(name, () => {
assert.strictEqual(name.capitalize(), "Super");
});
}
{
2024-12-10 10:21:56 +01:00
it("Empty string", () => {
assert.strictEqual("".capitalize(), "");
});
}
});