mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-04 21:15:47 +00:00
add test
This commit is contained in:
@@ -73,6 +73,10 @@ describe("Currency", function () {
|
||||
const xrp = new Currency(Buffer.alloc(20));
|
||||
expect(xrp.iso()).toBe("XRP");
|
||||
});
|
||||
test("Can handle non-standard currency codes", () => {
|
||||
const currency = "015841551A748AD2C1F76FF6ECB0CCCD00000000";
|
||||
expect(Currency.from(currency).toJSON()).toBe(currency);
|
||||
});
|
||||
test("throws on invalid reprs", function () {
|
||||
expect(() => Currency.from(Buffer.alloc(19))).toThrow();
|
||||
expect(() => Currency.from(1)).toThrow();
|
||||
|
||||
Reference in New Issue
Block a user