I have a project in which I have an azure-app-configuration module which wraps @azure/app-configuration.
For this module (specifically for the service I created that this module provides) I created a .spec test file using @golevelup/ts-jest.
I a mocking ConfigService like this:
const configServiceMock = createMock<ConfigService>({
get: jest.fn().mockReturnValue('Endpoint=*;Id=*;Secret=*'),
});
const moduleRef = await Test.createTestingModule({
providers: [
{
provide: ConfigService,
useValue: configServiceMock,
},
AzureAppConfigurationService,
],
}).compile();
This works fine in the context of a project I made, but now I'm trying to move this logic to, at the end, a nodejs package.
In the context of that however, I am getting a weird error:
Nest can't resolve dependencies of the AzureAppConfigurationService (?). Please make sure that the argument Function at index [0] is available in the RootTestModule context
Notifce it calls the argument "Function", as if it can't figure out it's a ConfigService mock under the hood.
But again, this works perfectly in the context of the original project, what gives?
I'm pretty sure I kept the same jest config between these projects...