import { SQLiteType , createTableIfNotExists } from './SchemaConverter' ; describe ( 'SchemaConverter' , ( ) => { describe ( 'createTableIfNotExists' , ( ) => { it ( 'constructs a string to create a table' , ( ) => { const statement = createTableIfNotExists ( 'prekeys' , { created : SQLiteType . REAL , id : SQLiteType . TEXT , serialised : SQLiteType . TEXT , version : SQLiteType . TEXT , } ) ; const expected = 'CREATE TABLE IF NOT EXISTS `prekeys` (`key` varchar(255) PRIMARY KEY,`created` real,`id` text,`serialised` text,`version` text);' ; expect ( statement ) . toBe ( expected ) ; } ) ; } ) ; } ) ;