2019-12-10 23:33:48 +01:00
|
|
|
import rewiremock from 'rewiremock';
|
|
|
|
import '../../../mocks/electron';
|
|
|
|
|
|
|
|
import { expect } from 'chai';
|
|
|
|
import 'mocha';
|
2020-07-25 02:02:37 +02:00
|
|
|
import { Database, getConnection } from './database';
|
2019-12-10 23:33:48 +01:00
|
|
|
|
|
|
|
describe('Database Service', () => {
|
|
|
|
before(() => {
|
|
|
|
rewiremock.enable();
|
|
|
|
});
|
|
|
|
|
|
|
|
after(() => {
|
|
|
|
rewiremock.disable();
|
|
|
|
});
|
|
|
|
|
|
|
|
it('returns a connection', async () => {
|
2020-07-25 02:02:37 +02:00
|
|
|
const libraryConnection = await getConnection(Database.LIBRARY);
|
2019-12-10 23:33:48 +01:00
|
|
|
expect(libraryConnection).to.not.equal(undefined);
|
|
|
|
});
|
|
|
|
});
|