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

31 lines
818 B
TypeScript
Raw Normal View History

import { OptionReminder, splitTime } from "../../../utils/commands/reminder";
2024-12-10 10:04:15 +01:00
import { describe, it } from "node:test";
import assert from "node:assert/strict";
describe("Time splitter", () => {
{
2024-12-10 10:21:56 +01:00
it("Empty String", () => {
assert.deepStrictEqual(splitTime(""), { option: OptionReminder.Nothing, time: "" });
});
}
{
const name = "2m@p";
2024-12-10 10:04:15 +01:00
it(name, () => {
assert.deepStrictEqual(splitTime(name), { option: OptionReminder.DirectMessage, time: "2m" });
});
}
{
const name = "41@";
2024-12-10 10:04:15 +01:00
it(name, () => {
assert.deepStrictEqual(splitTime(name), { option: OptionReminder.Mention, time: "41" });
});
}
{
const name = "0P";
2024-12-10 10:04:15 +01:00
it(name, () => {
assert.deepStrictEqual(splitTime(name), { option: OptionReminder.DirectMessage, time: "0" });
});
}
});