ci/woodpecker/pr/ci Pipeline failed
root cause: emitDecoratorMetadata reflected the third constructor parameter as Function and Nest attempted to resolve it fix: optional HANDOFF_ID_FACTORY injection token, no production provider, preserving undefined -> crypto.randomUUID() default and unchanged positional construction TDD: real CoordModule red at Function index [2], then green; test overrides only unrelated AuthGuard because its AUTH provider comes from AppModule's global AuthModule context Closes #1145
20 lines
784 B
TypeScript
20 lines
784 B
TypeScript
import 'reflect-metadata';
|
|
import { Test } from '@nestjs/testing';
|
|
import { describe, expect, it } from 'vitest';
|
|
import { CoordModule } from './coord.module.js';
|
|
import { InteractionCoordinationService } from './interaction-coordination.service.js';
|
|
import { AuthGuard } from '../auth/auth.guard.js';
|
|
|
|
describe('CoordModule DI (compiled-metadata boot)', () => {
|
|
it('resolves InteractionCoordinationService through Nest DI', async () => {
|
|
const moduleRef = await Test.createTestingModule({ imports: [CoordModule] })
|
|
.overrideGuard(AuthGuard)
|
|
.useValue({ canActivate: (): boolean => true })
|
|
.compile();
|
|
expect(moduleRef.get(InteractionCoordinationService)).toBeInstanceOf(
|
|
InteractionCoordinationService,
|
|
);
|
|
await moduleRef.close();
|
|
});
|
|
});
|