Botanique/tests/utils/commands/reminder.test.ts

31 lines
822 B
TypeScript
Raw Permalink Normal View History

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" });
});
}
});