Use unique sqlite file for every E2E test

Previously, this lead to locking errors, when multiple test runners accessed the same database and tried to clear it or tried to insert new test data.

Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
David Mehren 2020-10-24 12:30:23 +02:00
parent d42bc83e38
commit 26554f7168
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3
2 changed files with 3 additions and 4 deletions

View file

@ -25,7 +25,7 @@ describe('Notes', () => {
MediaModule, MediaModule,
TypeOrmModule.forRoot({ TypeOrmModule.forRoot({
type: 'sqlite', type: 'sqlite',
database: './hedgedoc-e2e.sqlite', database: './hedgedoc-e2e-media.sqlite',
autoLoadEntities: true, autoLoadEntities: true,
dropSchema: true, dropSchema: true,
synchronize: true, synchronize: true,

View file

@ -23,9 +23,10 @@ describe('Notes', () => {
GroupsModule, GroupsModule,
TypeOrmModule.forRoot({ TypeOrmModule.forRoot({
type: 'sqlite', type: 'sqlite',
database: './hedgedoc-e2e.sqlite', database: './hedgedoc-e2e-notes.sqlite',
autoLoadEntities: true, autoLoadEntities: true,
synchronize: true, synchronize: true,
dropSchema: true,
}), }),
LoggerModule, LoggerModule,
], ],
@ -34,8 +35,6 @@ describe('Notes', () => {
app = moduleRef.createNestApplication(); app = moduleRef.createNestApplication();
await app.init(); await app.init();
notesService = moduleRef.get(NotesService); notesService = moduleRef.get(NotesService);
const noteRepository = moduleRef.get('NoteRepository');
noteRepository.clear();
}); });
it(`POST /notes`, async () => { it(`POST /notes`, async () => {