39 lines
1.1 KiB
TypeScript
39 lines
1.1 KiB
TypeScript
import { ConfigService } from '@nestjs/config';
|
|
import { Test, TestingModule } from '@nestjs/testing';
|
|
import { DefaultParamsProvider } from '../../../../adapters/secondaries/default-params.provider';
|
|
import { IDefaultParams } from '../../../../domain/types/default-params.type';
|
|
|
|
const mockConfigService = {
|
|
get: jest.fn().mockImplementation(() => 'some_default_value'),
|
|
};
|
|
|
|
describe('DefaultParamsProvider', () => {
|
|
let defaultParamsProvider: DefaultParamsProvider;
|
|
|
|
beforeAll(async () => {
|
|
const module: TestingModule = await Test.createTestingModule({
|
|
imports: [],
|
|
providers: [
|
|
DefaultParamsProvider,
|
|
{
|
|
provide: ConfigService,
|
|
useValue: mockConfigService,
|
|
},
|
|
],
|
|
}).compile();
|
|
|
|
defaultParamsProvider = module.get<DefaultParamsProvider>(
|
|
DefaultParamsProvider,
|
|
);
|
|
});
|
|
|
|
it('should be defined', () => {
|
|
expect(defaultParamsProvider).toBeDefined();
|
|
});
|
|
|
|
it('should provide default params', async () => {
|
|
const params: IDefaultParams = defaultParamsProvider.getParams();
|
|
expect(params.GEOROUTER_URL).toBe('some_default_value');
|
|
});
|
|
});
|