1 // |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally
2 // Copyright (C) 2021 Igalia, S.L. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
6 esid: sec-temporal.plaindatetime.prototype.since
7 description: RangeError thrown when smallestUnit option not one of the allowed string values
11 const earlier = new Temporal.PlainDateTime(2000, 5, 2, 12, 34, 56, 0, 0, 0);
12 const later = new Temporal.PlainDateTime(2000, 5, 3, 13, 35, 57, 987, 654, 321);
26 for (const smallestUnit of badValues) {
27 assert.throws(RangeError, () => later.since(earlier, { smallestUnit }),
28 `"${smallestUnit}" is not a valid value for smallest unit`);