"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 928', () => {
    (0, vitest_1.it)('should inject the right instances', () => {
        let injectedA;
        let injectedB;
        let injectedC;
        // some dependencies
        let DepA = class DepA {
            a = 1;
        };
        DepA = tslib_1.__decorate([
            (0, __1.injectable)()
        ], DepA);
        let DepB = class DepB {
            b = 1;
        };
        DepB = tslib_1.__decorate([
            (0, __1.injectable)()
        ], DepB);
        let DepC = class DepC {
            c = 1;
        };
        DepC = tslib_1.__decorate([
            (0, __1.injectable)()
        ], DepC);
        let AbstractCls = class AbstractCls {
            constructor(a, b = { b: 0 }) {
                injectedA = a;
                injectedB = b;
            }
        };
        AbstractCls = tslib_1.__decorate([
            (0, __1.injectable)(),
            tslib_1.__param(0, (0, __1.inject)(DepA)),
            tslib_1.__param(1, (0, __1.inject)(DepB)),
            tslib_1.__param(1, (0, __1.optional)()),
            tslib_1.__metadata("design:paramtypes", [DepA,
                DepB])
        ], AbstractCls);
        let Cls = class Cls extends AbstractCls {
            constructor(c, b = { b: 0 }, a) {
                super(a, b);
                injectedC = c;
            }
        };
        Cls = tslib_1.__decorate([
            (0, __1.injectable)(),
            tslib_1.__param(0, (0, __1.inject)(DepC)),
            tslib_1.__param(1, (0, __1.inject)(DepB)),
            tslib_1.__param(1, (0, __1.optional)()),
            tslib_1.__param(2, (0, __1.inject)(DepA)),
            tslib_1.__metadata("design:paramtypes", [DepC,
                DepB,
                DepA])
        ], Cls);
        const container = new __1.Container();
        [DepA, DepB, DepC, Cls].forEach((i) => container.bind(i).toSelf().inSingletonScope());
        container.get(Cls);
        (0, vitest_1.expect)(injectedA).toStrictEqual(new DepA());
        (0, vitest_1.expect)(injectedB).toStrictEqual(new DepB());
        (0, vitest_1.expect)(injectedC).toStrictEqual(new DepC());
    });
});
//# sourceMappingURL=issue_928.test.js.map