1 changed files with 25 additions and 3 deletions
@ -1,7 +1,29 @@ |
|||||
import { initDB } from "../src/realm/dbInit"; |
import { initDB } from "../src/realm/dbInit"; |
||||
|
|
||||
test('Realm DB inits', async () => { |
test('Realm DB inits', () => { |
||||
let realmDB = await initDB(); |
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()); |
||||
|
}); |
||||
|
}); |
||||
|
|
||||
|
test('Realm DB inits with existing DB', () => { |
||||
|
return initDB() |
||||
|
.then( (dbRef) => { |
||||
|
expect(dbRef).toEqual(expect.anything()); |
||||
|
}); |
||||
|
}); |
||||
|
|
||||
expect |
test('Realm DB returns null after exceptions', () => { |
||||
|
return initDB('breakDB', 'breakDB') |
||||
|
.then( (dbRef) => { |
||||
|
expect(dbRef).toEqual(null); |
||||
|
}); |
||||
}); |
}); |
Loading…
Reference in new issue