Skip to content

Commit bafeb0a

Browse files
committed
test: add test for wrong argument type
1 parent b493979 commit bafeb0a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/parallel/test-sqlite-config.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,12 @@ test('defensive mode should be off after calling db.enableDefensive(false)', (t)
4545
db.enableDefensive(false);
4646
t.assert.strictEqual(checkDefensiveMode(db), false);
4747
});
48+
49+
test('throws if options.defensive is provided but is not a boolean', (t) => {
50+
t.assert.throws(() => {
51+
new DatabaseSync(':memory:', { defensive: 42 });
52+
}, {
53+
code: 'ERR_INVALID_ARG_TYPE',
54+
message: 'The "options.defensive" argument must be a boolean.',
55+
});
56+
});

0 commit comments

Comments
 (0)