UNPKG

bod

Version:
25 lines (24 loc) 1.13 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const tslib_1 = require("tslib"); const utils_1 = require("../../utils"); const InfoCommand_1 = tslib_1.__importDefault(require("../InfoCommand")); describe('infoCommand', () => { jest.setTimeout(20000); it('should extends [BaseCommand] fields', () => { const infoCommand = new InfoCommand_1.default(); expect(infoCommand.getName()).toBe('info'); expect(infoCommand.getDescription()).toBe('Print debugging information about your environment'); expect(infoCommand.getUsage()).toBe('info'); expect(infoCommand.getAlias()).toBe('i'); }); it('should print environment variables', () => tslib_1.__awaiter(void 0, void 0, void 0, function* () { const mockConsoleInfo = jest .spyOn(utils_1.printer, 'info') .mockImplementation(jest.fn()); const infoCommand = new InfoCommand_1.default(); yield expect(infoCommand.run()).resolves.toBeUndefined(); expect(mockConsoleInfo).toHaveBeenCalledTimes(2); mockConsoleInfo.mockRestore(); })); });