Botanique/tests/utils/commands/reminder.test.ts
Mylloon d8fb65f583
Some checks failed
PR Check / lint-and-format (pull_request) Failing after 32s
move tests to parent
2024-12-10 10:24:55 +01:00

30 lines
822 B
TypeScript

import { OptionReminder, splitTime } from "../../../src/utils/commands/reminder";
import { describe, it } from "node:test";
import assert from "node:assert/strict";
describe("Time splitter", () => {
{
it("Empty String", () => {
assert.deepStrictEqual(splitTime(""), { option: OptionReminder.Nothing, time: "" });
});
}
{
const name = "2m@p";
it(name, () => {
assert.deepStrictEqual(splitTime(name), { option: OptionReminder.DirectMessage, time: "2m" });
});
}
{
const name = "41@";
it(name, () => {
assert.deepStrictEqual(splitTime(name), { option: OptionReminder.Mention, time: "41" });
});
}
{
const name = "0P";
it(name, () => {
assert.deepStrictEqual(splitTime(name), { option: OptionReminder.DirectMessage, time: "0" });
});
}
});