import type { CRUDEngine } from '../engine' ; const TABLE_NAME = 'the-simpsons' ; export const clearTablesSpec = { 'clears all tables' : async ( engine ) => { await engine . create ( TABLE_NAME , 'one' , { name : 'Alpha' } ) ; let keys = await engine . readAll ( TABLE_NAME ) ; expect ( keys . length ) . toBe ( 1 ) ; await engine . clearTables ( ) ; keys = await engine . readAll ( TABLE_NAME ) ; expect ( keys . length ) . toBe ( 0 ) ; await engine . create ( TABLE_NAME , 'two' , { name : 'Beta' } ) ; const { name } = await engine . read < { name : string ; } > ( TABLE_NAME , 'two' ) ; expect ( name ) . toBe ( 'Beta' ) ; } , } ;