Skip to content

Commit

Permalink
Move test logic out of main files
Browse files Browse the repository at this point in the history
  • Loading branch information
lokankr committed Sep 12, 2023
1 parent c0466cd commit 643fdfc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
6 changes: 0 additions & 6 deletions src/infrastructure/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@ import type { RedisConfig } from '@lokalise/node-core'
const configScope: ConfigScope = new ConfigScope()
const redisDbValidator = createRangeValidator(0, 15)

type NestedPartial<T> = {
[P in keyof T]?: NestedPartial<T[P]>
}

export type ConfigOverrides = NestedPartial<Config>

export type IntervalJobConfig = {
periodInSeconds: number
}
Expand Down
9 changes: 8 additions & 1 deletion test/TestContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<T> = {
[P in keyof T]?: NestedPartial<T[P]>
}

export type ConfigOverrides = NestedPartial<Config>

export type TestContext = {
diContainer: AwilixContainer<Cradle>
}
Expand Down

0 comments on commit 643fdfc

Please sign in to comment.