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,
TypeOrmModule.forRoot({
type: 'sqlite',
database: './hedgedoc-e2e.sqlite',
database: './hedgedoc-e2e-media.sqlite',
autoLoadEntities: true,
dropSchema: true,
synchronize: true,

View file

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