Move array/function Duration.with tests to the missing-property test

This commit is contained in:
Manish Goregaokar 2025-07-01 14:41:40 -07:00 committed by Philip Chimento
parent a073f479f8
commit 749a6f9509
2 changed files with 12 additions and 2 deletions

View File

@ -15,6 +15,18 @@ assert.throws(
"Throws TypeError if no property is present" "Throws TypeError if no property is present"
); );
assert.throws(
TypeError,
() => instance.with([]),
"Throws TypeError if no property is present (with array)"
);
assert.throws(
TypeError,
() => instance.with(() => {}),
"Throws TypeError if no property is present (with function)"
);
assert.throws( assert.throws(
TypeError, TypeError,
() => instance.with({ nonsense: true }), () => instance.with({ nonsense: true }),

View File

@ -15,6 +15,4 @@ assert.throws(TypeError, () => instance.with(""), "empty string");
assert.throws(TypeError, () => instance.with(Symbol()), "Symbol"); assert.throws(TypeError, () => instance.with(Symbol()), "Symbol");
assert.throws(TypeError, () => instance.with(7), "number"); assert.throws(TypeError, () => instance.with(7), "number");
assert.throws(TypeError, () => instance.with(7n), "bigint"); assert.throws(TypeError, () => instance.with(7n), "bigint");
assert.throws(TypeError, () => instance.with([]), "array");
assert.throws(TypeError, () => instance.with(() => {}), "function");
assert.throws(TypeError, () => instance.with("string"), "string"); assert.throws(TypeError, () => instance.with("string"), "string");