UNPKG

bod

Version:
37 lines (36 loc) 1.57 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const tslib_1 = require("tslib"); const BaseCommand_1 = tslib_1.__importDefault(require("../BaseCommand")); const options = { name: 'base', description: 'Base command description', usage: 'base', alias: 'c', }; describe('baseCommand', () => { it('should have [name] field', () => { const baseCommand = new BaseCommand_1.default(options); expect(baseCommand.getName()).toBe(options.name); }); it('should have [description] field', () => { const baseCommand = new BaseCommand_1.default(options); expect(baseCommand.getDescription()).toBe(options.description); }); it('should have [usage] field', () => { const baseCommand = new BaseCommand_1.default(options); expect(baseCommand.getUsage()).toBe(options.usage); }); it('should have [alias] field', () => { const baseCommand = new BaseCommand_1.default(options); expect(baseCommand.getAlias()).toBe(options.alias); }); it('should set [alias] field to first character of [name] field by default', () => { const baseCommand = new BaseCommand_1.default(Object.assign(Object.assign({}, options), { alias: undefined })); expect(baseCommand.getAlias()).toBe(options.name[0]); }); it('should have [run] method', () => tslib_1.__awaiter(void 0, void 0, void 0, function* () { const baseCommand = new BaseCommand_1.default(options); yield expect(baseCommand.run()).resolves.toBeUndefined(); })); });