mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
refactor: e2e tests (#4536)
This commit is contained in:
parent
31987bc043
commit
4b59f83288
22 changed files with 189 additions and 201 deletions
|
|
@ -2,10 +2,11 @@ import { LoginResponseDto, UserResponseDto, UserService } from '@app/domain';
|
|||
import { AppModule, UserController } from '@app/immich';
|
||||
import { UserEntity } from '@app/infra/entities';
|
||||
import { INestApplication } from '@nestjs/common';
|
||||
import { getRepositoryToken } from '@nestjs/typeorm';
|
||||
import { api } from '@test/api';
|
||||
import { db } from '@test/db';
|
||||
import { errorStub, userSignupStub, userStub } from '@test/fixtures';
|
||||
import { createTestApp } from '@test/test-utils';
|
||||
import { testApp } from '@test/test-utils';
|
||||
import request from 'supertest';
|
||||
import { Repository } from 'typeorm';
|
||||
|
||||
|
|
@ -18,10 +19,12 @@ describe(`${UserController.name}`, () => {
|
|||
let userRepository: Repository<UserEntity>;
|
||||
|
||||
beforeAll(async () => {
|
||||
app = await createTestApp();
|
||||
userRepository = app.select(AppModule).get('UserEntityRepository');
|
||||
[server, app] = await testApp.create();
|
||||
userRepository = app.select(AppModule).get(getRepositoryToken(UserEntity));
|
||||
});
|
||||
|
||||
server = app.getHttpServer();
|
||||
afterAll(async () => {
|
||||
await testApp.teardown();
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue