test(server): auth e2e (#3492)

* test(server): auth controller e2e test

* test(server): user e2e test

* refactor(server): album e2e

* fix: linting
This commit is contained in:
Jason Rasmussen 2023-08-01 11:49:50 -04:00 committed by GitHub
parent 9e085c1071
commit e53625b067
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 927 additions and 496 deletions

21
server/test/e2e/setup.ts Normal file
View file

@ -0,0 +1,21 @@
import { GenericContainer, PostgreSqlContainer } from 'testcontainers';
export default async () => {
process.env.NODE_ENV = 'development';
process.env.TYPESENSE_API_KEY = 'abc123';
const pg = await new PostgreSqlContainer('postgres')
.withExposedPorts(5432)
.withDatabase('immich')
.withUsername('postgres')
.withPassword('postgres')
.withReuse()
.start();
process.env.DB_URL = pg.getConnectionUri();
const redis = await new GenericContainer('redis').withExposedPorts(6379).withReuse().start();
process.env.REDIS_PORT = String(redis.getMappedPort(6379));
process.env.REDIS_HOSTNAME = redis.getHost();
};