getting error when i try to run test cases
import { Test } from '@nestjs/testing';
import { appConfig } from '../app.config';
import { CommonBotModule } from '../common/common-bot.module';
import { CredentialsManagerModule } from '../credentials/credentials-manager.module';
import { BotModule } from './bot.module';
import { I18nService } from 'nestjs-i18n';
jest.mock('aws-sdk'); // Prevent DynamoDB connect
jest.mock('@aws/dynamodb-data-mapper'); // Prevent DynamoDB connect
jest.mock('kafkajs');
jest.mock('../cache/cacheConfig.service'); // Prevent Redis connect
describe('bot.module.ts', () => {
beforeAll(() => {
config.init(appConfig);
});
it('The bot module should be able to be compiled', async () => {
const botModule = await Test.createTestingModule({
imports: [CommonBotModule, CredentialsManagerModule, BotModule, I18nService]
}).compile();
expect(botModule).toBeDefined();
});
});
error :
Nest can’t resolve dependencies of the I18nService (?, I18nTranslations, I18nLanguages, Logger, I18nLoader, I18nLanguagesSubject, I18nTranslationsSubject). Please make sure that the argument I18nOptions at index [0] is available in the I18nService context.
Potential solutions:
- If I18nOptions is a provider, is it part of the current I18nService?
- If I18nOptions is exported from a separate @Module, is that module imported within I18nService?
@Module({
imports: [ /* the Module containing I18nOptions */ ]
})
New contributor
Nishad Mahajan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.