"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var DefaultOptions_1 = require("../../src/commands/DefaultOptions");
var GenJsonCommand_1 = require("../../src/commands/GenJsonCommand");
describe('BaseCommand', function () {
    it('Generates example from defined options', function () {
        var command = new GenJsonCommand_1.GenJsonCommand();
        expect(command.usageExamples()).toBe(' $ plexus gen-json-meta -b metadata -o src/gen -v -e .*options.*');
    });
    it('Parses verbose flag correctly', function () {
        var command = new GenJsonCommand_1.GenJsonCommand();
        expect(command.isVerbose({})).toBe(false);
        expect(command.isVerbose(null)).toBe(false);
        expect(command.isVerbose({ verbose: 'false' })).toBe(false);
        expect(command.isVerbose({ verbose: true })).toBe(true);
        expect(command.isVerbose({ verbose: 'true' })).toBe(true);
    });
    it('Generates option args', function () {
        var command = new GenJsonCommand_1.GenJsonCommand();
        var args = command.optionArgs({
            baseDir: 'baseDir',
            out: 'out',
        }, '=');
        expect(args.join(' ')).toBe('--baseDir=baseDir --out=out');
    });
    it('Fails validation if required option not provided', function () {
        var command = new GenJsonCommand_1.GenJsonCommand();
        expect(command.validateRequiredOpts([(0, DefaultOptions_1.baseDir)()], {}).length).toBe(1);
    });
    it('Passes validation if required option provided', function () {
        var command = new GenJsonCommand_1.GenJsonCommand();
        expect(command.validateRequiredOpts([(0, DefaultOptions_1.baseDir)()], {
            baseDir: 'value',
        }).length).toBe(0);
    });
});
//# sourceMappingURL=BaseCommand.spec.js.map