From 643fdfcecd99000c90ca15ddefe216748724724e Mon Sep 17 00:00:00 2001 From: Andreas Kristiansen Date: Tue, 12 Sep 2023 15:29:17 +0200 Subject: [PATCH] Move test logic out of main files --- src/infrastructure/config.ts | 6 ------ test/TestContext.ts | 9 ++++++++- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/infrastructure/config.ts b/src/infrastructure/config.ts index 66b282b9..4a8d0fa4 100644 --- a/src/infrastructure/config.ts +++ b/src/infrastructure/config.ts @@ -4,12 +4,6 @@ import type { RedisConfig } from '@lokalise/node-core' const configScope: ConfigScope = new ConfigScope() const redisDbValidator = createRangeValidator(0, 15) -type NestedPartial = { - [P in keyof T]?: NestedPartial -} - -export type ConfigOverrides = NestedPartial - export type IntervalJobConfig = { periodInSeconds: number } diff --git a/test/TestContext.ts b/test/TestContext.ts index 4ae3f17c..3ef8dca9 100644 --- a/test/TestContext.ts +++ b/test/TestContext.ts @@ -6,10 +6,17 @@ import { asFunction, createContainer } from 'awilix' import type { FastifyInstance } from 'fastify' import merge from 'ts-deepmerge' -import { getConfig, type ConfigOverrides } from '../src/infrastructure/config' +import type { Config } from '../src/infrastructure/config' +import { getConfig } from '../src/infrastructure/config' import type { DependencyOverrides } from '../src/infrastructure/diConfig' import { registerDependencies } from '../src/infrastructure/diConfig' +type NestedPartial = { + [P in keyof T]?: NestedPartial +} + +export type ConfigOverrides = NestedPartial + export type TestContext = { diContainer: AwilixContainer }