Botanique/tests/modules/string.test.ts

37 lines
715 B
TypeScript
Raw Permalink Normal View History

import "../../src/modules/string";
import { describe, it } from "node:test";
import assert from "node:assert/strict";
describe("Capitalize", () => {
{
const name = "test";
it(name, () => {
assert.strictEqual(name.capitalize(), "Test");
});
}
{
const name = "MACHIN";
it(name, () => {
assert.strictEqual(name.capitalize(), "MACHIN");
});
}
{
const name = "tRUC";
it(name, () => {
assert.strictEqual(name.capitalize(), "TRUC");
});
}
{
const name = "Super";
it(name, () => {
assert.strictEqual(name.capitalize(), "Super");
});
}
{
it("Empty string", () => {
assert.strictEqual("".capitalize(), "");
});
}
});