Skip to content
This repository was archived by the owner on Sep 17, 2024. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions modules/currency/tests/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ test(
const error = await assertRejects(async () => {
await ctx.modules.currency.withdraw({ userId: user.id, amount: 150 });
}, RuntimeError);
assertEquals(error.code, "NOT_ENOUGH_FUNDS");
assertEquals(error.code, "not_enough_funds");
},
);

Expand All @@ -45,7 +45,7 @@ test(
const error = await assertRejects(async () => {
await ctx.modules.currency.withdraw({ userId: user.id, amount: -100 });
}, RuntimeError);
assertEquals(error.code, "INVALID_AMOUNT");
assertEquals(error.code, "invalid_amount");
},
);

Expand All @@ -62,7 +62,7 @@ test(
amount: Infinity,
});
}, RuntimeError);
assertEquals(error.code, "INVALID_AMOUNT");
assertEquals(error.code, "invalid_amount");
},
);

Expand All @@ -76,7 +76,7 @@ test(
const error = await assertRejects(async () => {
await ctx.modules.currency.withdraw({ userId: user.id, amount: NaN });
}, RuntimeError);
assertEquals(error.code, "INVALID_AMOUNT");
assertEquals(error.code, "invalid_amount");
},
);

Expand All @@ -90,7 +90,7 @@ test(
const error = await assertRejects(async () => {
await ctx.modules.currency.deposit({ userId: user.id, amount: Infinity });
}, RuntimeError);
assertEquals(error.code, "INVALID_AMOUNT");
assertEquals(error.code, "invalid_amount");
},
);

Expand All @@ -104,7 +104,7 @@ test(
const error = await assertRejects(async () => {
await ctx.modules.currency.deposit({ userId: user.id, amount: NaN });
}, RuntimeError);
assertEquals(error.code, "INVALID_AMOUNT");
assertEquals(error.code, "invalid_amount");
},
);

Expand All @@ -118,7 +118,7 @@ test(
const error = await assertRejects(async () => {
await ctx.modules.currency.deposit({ userId: user.id, amount: -100 });
}, RuntimeError);
assertEquals(error.code, "INVALID_AMOUNT");
assertEquals(error.code, "invalid_amount");
},
);

Expand All @@ -132,7 +132,7 @@ test(
const error = await assertRejects(async () => {
await ctx.modules.currency.setBalance({ userId: user.id, balance: -1 });
}, RuntimeError);
assertEquals(error.code, "INVALID_AMOUNT");
assertEquals(error.code, "invalid_amount");
},
);

Expand All @@ -146,7 +146,7 @@ test(
const error = await assertRejects(async () => {
await ctx.modules.currency.setBalance({ userId: user.id, balance: NaN });
}, RuntimeError);
assertEquals(error.code, "INVALID_AMOUNT");
assertEquals(error.code, "invalid_amount");
},
);

Expand All @@ -164,6 +164,6 @@ test(
balance: Infinity,
});
}, RuntimeError);
assertEquals(error.code, "INVALID_AMOUNT");
assertEquals(error.code, "invalid_amount");
},
);