Improve various assertion messages

This commit is contained in:
Philip Chimento 2022-01-11 17:31:27 -08:00 committed by Rick Waldron
parent dcf184a0ee
commit 6058710478
4 changed files with 20 additions and 4 deletions

View File

@ -9,4 +9,8 @@ features: [Temporal]
const instance = new Temporal.Duration(1, 0, 0, 1);
const relativeTo = "2000-01-01T00:00+05:30[UTC]";
assert.throws(RangeError, () => instance.add(new Temporal.Duration(0, 0, 0, 0, -24), { relativeTo }));
assert.throws(
RangeError,
() => instance.add(new Temporal.Duration(0, 0, 0, 0, -24), { relativeTo }),
"add should throw RangeError on a string with UTC offset mismatch"
);

View File

@ -9,4 +9,8 @@ features: [Temporal]
const instance = new Temporal.Duration(1, 0, 0, 0, 24);
const relativeTo = "2000-01-01T00:00+05:30[UTC]";
assert.throws(RangeError, () => instance.round({ largestUnit: "years", relativeTo }));
assert.throws(
RangeError,
() => instance.round({ largestUnit: "years", relativeTo }),
"round should throw RangeError on a string with UTC offset mismatch"
);

View File

@ -9,4 +9,8 @@ features: [Temporal]
const instance = new Temporal.Duration(1, 0, 0, 1);
const relativeTo = "2000-01-01T00:00+05:30[UTC]";
assert.throws(RangeError, () => instance.subtract(new Temporal.Duration(0, 0, 0, 0, 24), { relativeTo }));
assert.throws(
RangeError,
() => instance.subtract(new Temporal.Duration(0, 0, 0, 0, 24), { relativeTo }),
"subtract should throw RangeError on a string with UTC offset mismatch"
);

View File

@ -9,4 +9,8 @@ features: [Temporal]
const instance = new Temporal.Duration(1, 0, 0, 0, 24);
const relativeTo = "2000-01-01T00:00+05:30[UTC]";
assert.throws(RangeError, () => instance.total({ unit: "days", relativeTo }));
assert.throws(
RangeError,
() => instance.total({ unit: "days", relativeTo }),
"total should throw RangeError on a string with UTC offset mismatch"
);