diff --git a/tests/unit/sql-utils.test.ts b/tests/unit/sql-utils.test.ts index aa5cfc6..0331d2c 100644 --- a/tests/unit/sql-utils.test.ts +++ b/tests/unit/sql-utils.test.ts @@ -209,5 +209,16 @@ describe('SQL Utils', () => { assert.throws(() => validateRowIds([Infinity, 2]), /Invalid rowid: Infinity/); assert.throws(() => validateRowIds(['1', 'abc']), /Invalid rowid: abc/); }); + + it('should throw TypeError when given non-array malformed inputs', () => { + // @ts-ignore + assert.throws(() => validateRowIds(null), TypeError); + // @ts-ignore + assert.throws(() => validateRowIds(undefined), TypeError); + // @ts-ignore + assert.throws(() => validateRowIds({}), TypeError); + // @ts-ignore + assert.throws(() => validateRowIds(123), TypeError); + }); }); });