fix(api): apply feedback + enhance typing

This commit is contained in:
yassinedorbozgithub 2025-06-16 16:00:53 +01:00
parent 027d610578
commit d2b9c1248c

View File

@ -36,11 +36,10 @@ type buildTestingMocksProps<
| { | {
providers: NonNullable<P>; providers: NonNullable<P>;
controllers: NonNullable<C>; controllers: NonNullable<C>;
autoInjectFrom?: 'all'[]; autoInjectFrom: 'all'[];
} }
| { | {
providers: NonNullable<P>; providers: NonNullable<P>;
controllers?: undefined;
autoInjectFrom?: 'providers'[]; autoInjectFrom?: 'providers'[];
} }
| { | {
@ -188,7 +187,7 @@ export const buildTestingMocks = async ({
? [ ? [
MongooseModule.forFeature([ MongooseModule.forFeature([
...getModels(models), ...getModels(models),
...(!!autoInjectFrom ...(autoInjectFrom
? getNestedModels(nestedProviders, 'Repository') ? getNestedModels(nestedProviders, 'Repository')
: []), : []),
]), ]),