parent
e0d4353d98
commit
89a267eb22
|
@ -21,19 +21,26 @@ import { initDb } from '../src/db/postgre';
|
||||||
import TestChart from '../src/services/chart/charts/classes/test';
|
import TestChart from '../src/services/chart/charts/classes/test';
|
||||||
import TestGroupedChart from '../src/services/chart/charts/classes/test-grouped';
|
import TestGroupedChart from '../src/services/chart/charts/classes/test-grouped';
|
||||||
import TestUniqueChart from '../src/services/chart/charts/classes/test-unique';
|
import TestUniqueChart from '../src/services/chart/charts/classes/test-unique';
|
||||||
|
import { Connection } from 'typeorm';
|
||||||
|
|
||||||
describe('Chart', () => {
|
describe('Chart', () => {
|
||||||
let testChart: any;
|
let testChart: any;
|
||||||
let testGroupedChart: any;
|
let testGroupedChart: any;
|
||||||
let testUniqueChart: any;
|
let testUniqueChart: any;
|
||||||
let clock: lolex.InstalledClock<lolex.Clock>;
|
let clock: lolex.InstalledClock<lolex.Clock>;
|
||||||
|
let connection: Connection;
|
||||||
|
|
||||||
before(done => {
|
before(done => {
|
||||||
initDb(true).then(c => {
|
initDb(true).then(c => {
|
||||||
|
connection = c;
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
after(done => {
|
||||||
|
connection.close().then(done);
|
||||||
|
});
|
||||||
|
|
||||||
beforeEach(done => {
|
beforeEach(done => {
|
||||||
testChart = new TestChart();
|
testChart = new TestChart();
|
||||||
testGroupedChart = new TestGroupedChart();
|
testGroupedChart = new TestGroupedChart();
|
||||||
|
@ -42,12 +49,13 @@ describe('Chart', () => {
|
||||||
clock = lolex.install({
|
clock = lolex.install({
|
||||||
now: new Date('2000-01-01 00:00:00')
|
now: new Date('2000-01-01 00:00:00')
|
||||||
});
|
});
|
||||||
done();
|
|
||||||
|
connection.synchronize().then(done);
|
||||||
});
|
});
|
||||||
|
|
||||||
afterEach(done => {
|
afterEach(done => {
|
||||||
clock.uninstall();
|
clock.uninstall();
|
||||||
done();
|
connection.dropDatabase().then(done);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Can updates', async(async () => {
|
it('Can updates', async(async () => {
|
||||||
|
|
Loading…
Reference in New Issue