From 89a267eb22991e69e9f356043102dcb7549a2efd Mon Sep 17 00:00:00 2001 From: rinsuki <428rinsuki+git@gmail.com> Date: Fri, 25 Oct 2019 20:36:17 +0900 Subject: [PATCH] =?UTF-8?q?Revert=20"=E4=B8=80=E5=9B=9E=E4=B8=80=E5=9B=9Es?= =?UTF-8?q?ync=E2=86=92drop=E3=81=97=E3=81=A6=E3=82=8B=E3=81=AE=E3=82=92?= =?UTF-8?q?=E3=82=84=E3=82=81=E3=81=A6=E3=81=BF=E3=82=8B"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit a9e543ba2eef790ac7a14ae8799b898765748e35. --- test/chart.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/test/chart.ts b/test/chart.ts index 5a9508293f..0b53763ff9 100644 --- a/test/chart.ts +++ b/test/chart.ts @@ -21,19 +21,26 @@ import { initDb } from '../src/db/postgre'; import TestChart from '../src/services/chart/charts/classes/test'; import TestGroupedChart from '../src/services/chart/charts/classes/test-grouped'; import TestUniqueChart from '../src/services/chart/charts/classes/test-unique'; +import { Connection } from 'typeorm'; describe('Chart', () => { let testChart: any; let testGroupedChart: any; let testUniqueChart: any; let clock: lolex.InstalledClock; + let connection: Connection; before(done => { initDb(true).then(c => { + connection = c; done(); }); }); + after(done => { + connection.close().then(done); + }); + beforeEach(done => { testChart = new TestChart(); testGroupedChart = new TestGroupedChart(); @@ -42,12 +49,13 @@ describe('Chart', () => { clock = lolex.install({ now: new Date('2000-01-01 00:00:00') }); - done(); + + connection.synchronize().then(done); }); afterEach(done => { clock.uninstall(); - done(); + connection.dropDatabase().then(done); }); it('Can updates', async(async () => {