From 2030141c667122a41bf299af2b9221f1cff8bfd4 Mon Sep 17 00:00:00 2001 From: David Mehren Date: Tue, 22 Sep 2020 20:09:36 +0200 Subject: [PATCH] Note E2E tests: Use on-disk sqlite to aid debugging It was helpful to inspect database contents while the code was stopped by the debugger. Therefore the E2E test database is now persisted on disk and cleared before every test-run. Signed-off-by: David Mehren --- test/public-api/notes.e2e-spec.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/public-api/notes.e2e-spec.ts b/test/public-api/notes.e2e-spec.ts index fad8db385..ba978d2ba 100644 --- a/test/public-api/notes.e2e-spec.ts +++ b/test/public-api/notes.e2e-spec.ts @@ -21,7 +21,7 @@ describe('Notes', () => { GroupsModule, TypeOrmModule.forRoot({ type: 'sqlite', - database: ':memory:', + database: './hedgedoc-e2e.sqlite', autoLoadEntities: true, synchronize: true, }), @@ -31,6 +31,8 @@ describe('Notes', () => { app = moduleRef.createNestApplication(); await app.init(); notesService = moduleRef.get(NotesService); + const noteRepository = moduleRef.get('NoteRepository'); + noteRepository.clear(); }); it(`POST /notes`, async () => {