Mylloon
a790ddf377
All checks were successful
Publish latest version / build (push) Successful in 2m11s
Close #201 Tests run much faster and we don't need as much as libs Reviewed-on: #210 Co-authored-by: Mylloon <kennel.anri@tutanota.com> Co-committed-by: Mylloon <kennel.anri@tutanota.com>
30 lines
822 B
TypeScript
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" });
|
|
});
|
|
}
|
|
});
|