Skip to content

Commit

Permalink
fix: update error messages in tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris-Hibbert committed Aug 20, 2021
1 parent e61ba9d commit 76d590d
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions packages/zoe/test/unitTests/contractSupport/test-ratio.js
Original file line number Diff line number Diff line change
Expand Up @@ -404,19 +404,19 @@ test('ratio bad inputs', t => {
message: '100.5 not a safe integer',
});
t.throws(() => makeRatioFromAmounts(3n, moe(30n)), {
message: `The brand "[3n]" doesn't look like a brand.`,
message: `The brand "[undefined]" doesn't look like a brand.`,
});
t.throws(() => floorMultiplyBy(37, makeRatioFromAmounts(moe(3n), moe(5n))), {
message: `The brand 37 doesn't look like a brand.`,
message: `The brand "[undefined]" doesn't look like a brand.`,
});
t.throws(() => ceilMultiplyBy(37, makeRatioFromAmounts(moe(3n), moe(5n))), {
message: `The brand 37 doesn't look like a brand.`,
message: `The brand "[undefined]" doesn't look like a brand.`,
});
t.throws(() => floorDivideBy(makeRatioFromAmounts(moe(3n), moe(5n)), 37), {
message: `The brand {"numerator":{"brand":"[Alleged: moe brand]","value":"[3n]"},"denominator":{"brand":"[Seen]","value":"[5n]"}} doesn't look like a brand.`,
message: `The brand "[undefined]" doesn't look like a brand.`,
});
t.throws(() => ceilDivideBy(makeRatioFromAmounts(moe(3n), moe(5n)), 37), {
message: `The brand {"numerator":{"brand":"[Alleged: moe brand]","value":"[3n]"},"denominator":{"brand":"[Seen]","value":"[5n]"}} doesn't look like a brand.`,
message: `The brand "[undefined]" doesn't look like a brand.`,
});
t.throws(() => makeRatio(3n, brand, 0n), {
message: /No infinite ratios! Denominator was 0/,
Expand All @@ -436,10 +436,10 @@ test('ratio bad inputs deprecated', t => {
const moe = value => AmountMath.make(value, brand);
// @ts-ignore invalid arguments for testing
t.throws(() => multiplyBy(37, makeRatioFromAmounts(moe(3n), moe(5n))), {
message: `The brand 37 doesn't look like a brand.`,
message: `The brand "[undefined]" doesn't look like a brand.`,
});
t.throws(() => divideBy(makeRatioFromAmounts(moe(3n), moe(5n)), 37), {
message: `The brand {"numerator":{"brand":"[Alleged: moe brand]","value":"[3n]"},"denominator":{"brand":"[Seen]","value":"[5n]"}} doesn't look like a brand.`,
message: `The brand "[undefined]" doesn't look like a brand.`,
});
});

Expand Down

0 comments on commit 76d590d

Please sign in to comment.