"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const vitest_1 = require("vitest");
const __1 = require("../..");
(0, vitest_1.describe)('Issue 1515', () => {
    (0, vitest_1.it)('should properly throw on circular dependency', () => {
        let Circle1 = class Circle1 {
            circle2;
            constructor(circle2) {
                this.circle2 = circle2;
            }
        };
        Circle1 = tslib_1.__decorate([
            (0, __1.injectable)(),
            tslib_1.__param(0, (0, __1.inject)('circle-2')),
            tslib_1.__metadata("design:paramtypes", [Object])
        ], Circle1);
        let Circle2 = class Circle2 {
            circle1;
            constructor(circle1) {
                this.circle1 = circle1;
            }
        };
        Circle2 = tslib_1.__decorate([
            (0, __1.injectable)(),
            tslib_1.__param(0, (0, __1.inject)('circle-1')),
            tslib_1.__metadata("design:paramtypes", [Object])
        ], Circle2);
        let Multi1 = class Multi1 {
        };
        Multi1 = tslib_1.__decorate([
            (0, __1.injectable)()
        ], Multi1);
        let Multi2 = class Multi2 {
        };
        Multi2 = tslib_1.__decorate([
            (0, __1.injectable)()
        ], Multi2);
        let Multi3 = class Multi3 {
        };
        Multi3 = tslib_1.__decorate([
            (0, __1.injectable)()
        ], Multi3);
        let Top = class Top {
            multis;
            circle1;
            constructor(multis, circle1) {
                this.multis = multis;
                this.circle1 = circle1;
            }
        };
        Top = tslib_1.__decorate([
            (0, __1.injectable)(),
            tslib_1.__param(0, (0, __1.multiInject)('multi-inject')),
            tslib_1.__param(1, (0, __1.inject)('circle-1')),
            tslib_1.__metadata("design:paramtypes", [Array, Object])
        ], Top);
        const container = new __1.Container();
        container.bind('multi-inject').to(Multi1);
        container.bind('multi-inject').to(Multi2);
        container.bind('multi-inject').to(Multi3);
        container.bind('circle-1').to(Circle1);
        container.bind('circle-2').to(Circle2);
        container.bind(Top).toSelf();
        (0, vitest_1.expect)(() => {
            container.get(Top);
        }).toThrow('Circular dependency found: Top -> circle-1 -> circle-2 -> circle-1');
    });
});
//# sourceMappingURL=issue_1515.test.js.map