summaryrefslogtreecommitdiff
path: root/test/parallel/test-util-format.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/parallel/test-util-format.js')
-rw-r--r--test/parallel/test-util-format.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/parallel/test-util-format.js b/test/parallel/test-util-format.js
index 810e9ac114..2ef0528490 100644
--- a/test/parallel/test-util-format.js
+++ b/test/parallel/test-util-format.js
@@ -408,3 +408,20 @@ assert.strictEqual(
),
'[ 1, [Object] ]'
);
+
+[
+ undefined,
+ null,
+ false,
+ 5n,
+ 5,
+ 'test',
+ Symbol()
+].forEach((invalidOptions) => {
+ assert.throws(() => {
+ util.formatWithOptions(invalidOptions, { a: true });
+ }, {
+ code: 'ERR_INVALID_ARG_TYPE',
+ message: /"inspectOptions".+object/
+ });
+});