"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const vitest_1 = require("vitest");
const index_1 = require("../../index");
(0, vitest_1.describe)('Issue 1190', () => {
    (0, vitest_1.it)('should inject a katana as default weapon to ninja', () => {
        // eslint-disable-next-line @typescript-eslint/typedef
        const TYPES = {
            Weapon: 'Weapon',
        };
        // eslint-disable-next-line @typescript-eslint/typedef
        const TAG = {
            throwable: 'throwable',
        };
        let Katana = class Katana {
            name;
            constructor() {
                this.name = 'Katana';
            }
        };
        Katana = tslib_1.__decorate([
            (0, index_1.injectable)(),
            tslib_1.__metadata("design:paramtypes", [])
        ], Katana);
        let Shuriken = class Shuriken {
            name;
            constructor() {
                this.name = 'Shuriken';
            }
        };
        Shuriken = tslib_1.__decorate([
            (0, index_1.injectable)(),
            tslib_1.__metadata("design:paramtypes", [])
        ], Shuriken);
        let Ninja = class Ninja {
            name;
            katana;
            shuriken;
            constructor(katana, shuriken) {
                this.name = 'Ninja';
                this.katana = katana;
                this.shuriken = shuriken;
            }
        };
        Ninja = tslib_1.__decorate([
            (0, index_1.injectable)(),
            tslib_1.__param(0, (0, index_1.inject)(TYPES.Weapon)),
            tslib_1.__param(0, (0, index_1.optional)()),
            tslib_1.__param(1, (0, index_1.inject)(TYPES.Weapon)),
            tslib_1.__param(1, (0, index_1.named)(TAG.throwable)),
            tslib_1.__metadata("design:paramtypes", [Object, Object])
        ], Ninja);
        const container = new index_1.Container();
        container.bind(TYPES.Weapon).to(Katana).whenDefault();
        container.bind(TYPES.Weapon).to(Shuriken).whenNamed(TAG.throwable);
        container.bind('Ninja').to(Ninja);
        const ninja = container.get('Ninja');
        (0, vitest_1.expect)(ninja.katana).toStrictEqual(new Katana());
    });
});
//# sourceMappingURL=issue_1190.test.js.map