mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-16 17:46:45 +00:00
18 lines
561 B
TypeScript
18 lines
561 B
TypeScript
import { ServiceA } from './fixtures/service-a';
|
|
import { ServiceB } from './fixtures/service-b';
|
|
import { Container } from '../di';
|
|
|
|
describe('DI Container', () => {
|
|
describe('circular dependency', () => {
|
|
it('should detect multilevel circular dependencies', () => {
|
|
expect(() => Container.get(ServiceA)).toThrow(
|
|
'[DI] Circular dependency detected in ServiceB at index 0.\nServiceA -> ServiceB',
|
|
);
|
|
|
|
expect(() => Container.get(ServiceB)).toThrow(
|
|
'[DI] Circular dependency detected in ServiceB at index 0.\nServiceB',
|
|
);
|
|
});
|
|
});
|
|
});
|