mirror of
https://github.com/Kir-Antipov/mc-publish.git
synced 2024-11-21 16:00:59 -05:00
Added tests for curseforge-project
This commit is contained in:
parent
c7659c2f43
commit
2c6ab90c5f
1 changed files with 31 additions and 0 deletions
31
tests/unit/platforms/curseforge/curseforge-project.spec.ts
Normal file
31
tests/unit/platforms/curseforge/curseforge-project.spec.ts
Normal file
|
@ -0,0 +1,31 @@
|
|||
import { isCurseForgeProjectId } from "@/platforms/curseforge/curseforge-project";
|
||||
|
||||
describe("isCurseForgeProjectId", () => {
|
||||
test("returns true when input is a number", () => {
|
||||
expect(isCurseForgeProjectId(123456)).toBe(true);
|
||||
});
|
||||
|
||||
test("returns true when input is a string containing an integer", () => {
|
||||
expect(isCurseForgeProjectId("123456")).toBe(true);
|
||||
});
|
||||
|
||||
test("returns false when input is a string containing non-integer characters", () => {
|
||||
expect(isCurseForgeProjectId("123abc")).toBe(false);
|
||||
});
|
||||
|
||||
test("returns false when input is a string containing floating point number", () => {
|
||||
expect(isCurseForgeProjectId("123.456")).toBe(false);
|
||||
});
|
||||
|
||||
test("returns false when input is an empty string", () => {
|
||||
expect(isCurseForgeProjectId("")).toBe(false);
|
||||
});
|
||||
|
||||
test("returns false when input is null", () => {
|
||||
expect(isCurseForgeProjectId(null)).toBe(false);
|
||||
});
|
||||
|
||||
test("returns false when input is undefined", () => {
|
||||
expect(isCurseForgeProjectId(undefined)).toBe(false);
|
||||
});
|
||||
});
|
Loading…
Reference in a new issue