UNPKG

@sprucelabs/spruce-cli

Version:

Command line interface for building Spruce skills.

41 lines 2.1 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 test_utils_2 = require("@sprucelabs/test-utils"); const AbstractErrorTest_1 = __importDefault(require("../../../tests/AbstractErrorTest")); class SettingUpErrorTest extends AbstractErrorTest_1.default { static async failsIfSkillIsNotInstalled() { const fixture = this.FeatureFixture(); const err = await test_utils_1.assert.doesThrowAsync(() => fixture.installFeatures([ { code: 'error', }, ])); test_utils_2.errorAssert.assertError(err, 'VALIDATION_FAILED'); } static async installsSchemasIfNotInstalled() { await this.installErrorFeature('errors'); const installer = this.featureInstaller; const isSchemaInstalled = await installer.isInstalled('schema'); test_utils_1.assert.isTrue(isSchemaInstalled); const isErrorInstalled = await installer.isInstalled('error'); test_utils_1.assert.isTrue(isErrorInstalled); } } exports.default = SettingUpErrorTest; __decorate([ (0, test_utils_1.test)() ], SettingUpErrorTest, "failsIfSkillIsNotInstalled", null); __decorate([ (0, test_utils_1.test)() ], SettingUpErrorTest, "installsSchemasIfNotInstalled", null); //# sourceMappingURL=SettingUpErrors.test.js.map