diff --git a/squarenotsquare/__tests__/DB-Setup-test.js b/squarenotsquare/__tests__/DB-Setup-test.js index ca6c85a..cdaa3b1 100644 --- a/squarenotsquare/__tests__/DB-Setup-test.js +++ b/squarenotsquare/__tests__/DB-Setup-test.js @@ -1,7 +1,29 @@ import { initDB } from "../src/realm/dbInit"; -test('Realm DB inits', async () => { - let realmDB = await initDB(); +test('Realm DB inits', () => { + return initDB('negTest', 'negTest') + .then( (dbRef) => { + expect(dbRef).toEqual(expect.anything()); + }); +}); - expect +test('Realm DB inits with no existing key', () => { + return initDB('isNull', 'isNull') + .then( (dbRef) => { + expect(dbRef).toEqual(expect.anything()); + }); +}); + +test('Realm DB inits with existing DB', () => { + return initDB() + .then( (dbRef) => { + expect(dbRef).toEqual(expect.anything()); + }); +}); + +test('Realm DB returns null after exceptions', () => { + return initDB('breakDB', 'breakDB') + .then( (dbRef) => { + expect(dbRef).toEqual(null); + }); }); \ No newline at end of file