UNPKG

@sprucelabs/spruce-cli

Version:

Command line interface for building Spruce skills.

53 lines 2.84 kB
"use strict"; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const test_utils_1 = require("@sprucelabs/test-utils"); const AbstractCliTest_1 = __importDefault(require("../../tests/AbstractCliTest")); const test_utility_1 = __importDefault(require("../../tests/utilities/test.utility")); class SettingUpVscodeTest extends AbstractCliTest_1.default { static async hasSetupAction() { test_utils_1.assert.isFunction(this.Action('vscode', 'setup').execute); } static async settingUpAsksAboutExtensonsAndSetsUpDebug() { await this.FeatureFixture().installCachedFeatures('skills'); const promise = this.Action('vscode', 'setup').execute({}); await this.waitForInput(); test_utils_1.assert.isEqualDeep(this.ui.getLastInvocation(), { command: 'confirm', options: 'Want me to setup debugging for you?', }); await this.ui.sendInput('y'); await this.waitForInput(); test_utils_1.assert.isEqualDeep(this.ui.getLastInvocation(), { command: 'confirm', options: 'Want me to setup vscode settings for building, testing and linting on save?', }); await this.ui.sendInput('y'); await this.waitForInput(); test_utils_1.assert.isEqualDeep(this.ui.getLastInvocation(), { command: 'confirm', options: 'Want me to setup tasks for building and testing?', }); await this.ui.sendInput('y'); const results = await promise; test_utils_1.assert.isFalsy(results.errors); const match = test_utility_1.default.assertFileByNameInGeneratedFiles('launch.json', results.files ?? []); test_utils_1.assert.isEqual(match, this.resolvePath('.vscode/launch.json')); } } exports.default = SettingUpVscodeTest; __decorate([ (0, test_utils_1.test)() ], SettingUpVscodeTest, "hasSetupAction", null); __decorate([ test_utils_1.test.skip('Cant run on machine without vscode installed') ], SettingUpVscodeTest, "settingUpAsksAboutExtensonsAndSetsUpDebug", null); //# sourceMappingURL=SettingUpVscode.test.js.map