Browse Source

db setup tests

pull/1/head
Tim Glasgow 2 years ago
parent
commit
35421e2aae
  1. 28
      squarenotsquare/__tests__/DB-Setup-test.js

28
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());
});
});
test('Realm DB inits with no existing key', () => {
return initDB('isNull', 'isNull')
.then( (dbRef) => {
expect(dbRef).toEqual(expect.anything());
});
});
expect
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);
});
});
Loading…
Cancel
Save