chore: update test & fix spelling

This commit is contained in:
Tien Nguyen Khac 2022-06-25 23:17:06 +12:00
parent 048169fd3f
commit bd8c2b8c18
2 changed files with 4 additions and 2 deletions

View File

@ -33,7 +33,9 @@ describe("Decimal", () => {
});
it("throws for atomics that are not non-negative integers", () => {
expect(() => Decimal.fromAtomics("-1", 0)).toThrowError(/atomics must not be negative/i);
expect(() => Decimal.fromAtomics("-1", 0)).toThrowError(
/invalid string format. Only non-negative integers in decimal representation supported/i,
);
});
});

View File

@ -109,7 +109,7 @@ export class Decimal {
private constructor(atomics: string, fractionalDigits: number) {
if (!atomics.match(/^[0-9]+$/)) {
throw new Error(
"Invalid string format. Only non-negative integers in decimal representation suppored.",
"Invalid string format. Only non-negative integers in decimal representation supported.",
);
}