@@ -257,6 +257,40 @@ test('a finished iterator stays done and does not restart', () => {
257257 assert . strictEqual ( iter . next ( ) . done , true ) ;
258258} ) ;
259259
260+ test ( 'createTagStore throws on invalid maxSize' , ( ) => {
261+ const db = new DatabaseSync ( ':memory:' ) ;
262+
263+ assert . throws ( ( ) => db . createTagStore ( 0 ) , {
264+ code : 'ERR_OUT_OF_RANGE' ,
265+ message : / m a x S i z e / ,
266+ } ) ;
267+
268+ assert . throws ( ( ) => db . createTagStore ( - 1 ) , {
269+ code : 'ERR_OUT_OF_RANGE' ,
270+ message : / m a x S i z e / ,
271+ } ) ;
272+
273+ assert . throws ( ( ) => db . createTagStore ( NaN ) , {
274+ code : 'ERR_OUT_OF_RANGE' ,
275+ message : / m a x S i z e / ,
276+ } ) ;
277+
278+ assert . throws ( ( ) => db . createTagStore ( 1.5 ) , {
279+ code : 'ERR_OUT_OF_RANGE' ,
280+ message : / m a x S i z e / ,
281+ } ) ;
282+
283+ assert . throws ( ( ) => db . createTagStore ( 'abc' ) , {
284+ code : 'ERR_INVALID_ARG_TYPE' ,
285+ message : / m a x S i z e / ,
286+ } ) ;
287+
288+ assert . throws ( ( ) => db . createTagStore ( Number . MAX_SAFE_INTEGER ) , {
289+ code : 'ERR_OUT_OF_RANGE' ,
290+ message : / m a x S i z e / ,
291+ } ) ;
292+ } ) ;
293+
260294test ( 'sql.db returns the associated DatabaseSync instance' , ( ) => {
261295 assert . strictEqual ( sql . db , db ) ;
262296} ) ;
0 commit comments