Skip to content

Commit

Permalink
Fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nzapponi committed Jan 18, 2024
1 parent 169468b commit 6373e8c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/devid.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ChecksumError, FormatError } from "../src/errors";
import { DevIDError } from "../src/errors";
import devid, { DevID, setDelimiter } from "../src/devid";

describe("devid creation", () => {
Expand Down Expand Up @@ -27,7 +27,7 @@ describe("devid creation", () => {
it("should fail to create a devid if the prefix is too long", () => {
expect(() => {
devid("1234567890123456789012345");
}).toThrow(FormatError);
}).toThrow(DevIDError);
});
});

Expand Down Expand Up @@ -60,14 +60,14 @@ describe("devid parsing", () => {
it("should fail to initialize a devid if there are invalid characters", () => {
expect(() => {
devid("12345678901234567890123.");
}).toThrow(FormatError);
}).toThrow(DevIDError);
});

it("should fail to initialize a devid if it was tampered with", () => {
let id = devid().toString().split("");
id[0] = id[0] === "1" ? "2" : "1";
expect(() => {
devid(id.join(""));
}).toThrow(ChecksumError);
}).toThrow(DevIDError);
});
});

0 comments on commit 6373e8c

Please sign in to comment.