diff --git a/web/database/sql-js.test.js b/web/database/sql-js.test.js new file mode 100644 --- /dev/null +++ b/web/database/sql-js.test.js @@ -0,0 +1,19 @@ +// @flow + +import initSqlJs from 'sql.js'; + +import { getSQLiteDBVersion } from './queries/db-queries.js'; + +describe('sql.js', () => { + it('should construct a Database', async () => { + const SQL = await initSqlJs(); + const db = new SQL.Database(); + expect(db).not.toBe(undefined); + }); + + it('should return default database version', async () => { + const SQL = await initSqlJs(); + const db = new SQL.Database(); + expect(getSQLiteDBVersion(db)).toBe(0); + }); +});