diff options
Diffstat (limited to 'js/src/tests/test262/built-ins/Temporal/PlainTime/prototype/toString/roundingmode-wrong-type.js')
-rw-r--r-- | js/src/tests/test262/built-ins/Temporal/PlainTime/prototype/toString/roundingmode-wrong-type.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/Temporal/PlainTime/prototype/toString/roundingmode-wrong-type.js b/js/src/tests/test262/built-ins/Temporal/PlainTime/prototype/toString/roundingmode-wrong-type.js new file mode 100644 index 0000000000..2d7a86a9c0 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainTime/prototype/toString/roundingmode-wrong-type.js @@ -0,0 +1,18 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2021 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaintime.prototype.tostring +description: Type conversions for roundingMode option +includes: [compareArray.js, temporalHelpers.js] +features: [Temporal] +---*/ + +const time = new Temporal.PlainTime(12, 34, 56, 123, 987, 500); +TemporalHelpers.checkStringOptionWrongType("roundingMode", "trunc", + (roundingMode) => time.toString({ smallestUnit: "microsecond", roundingMode }), + (result, descr) => assert.sameValue(result, "12:34:56.123987", descr), +); + +reportCompare(0, 0); |