UNPKG

@sprucelabs/spruce-cli

Version:

Command line interface for building Spruce skills.

46 lines 2.44 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 spruce_skill_utils_1 = require("@sprucelabs/spruce-skill-utils"); const test_utils_1 = require("@sprucelabs/test-utils"); const AbstractSkillTest_1 = __importDefault(require("../../../tests/AbstractSkillTest")); const generateShortAlphaId_1 = __importDefault(require("../permissions/support/generateShortAlphaId")); class SyncingSchemasInChildDirInGoTest extends AbstractSkillTest_1.default { static skillCacheKey = 'schemas'; static schemaNameCamel = (0, generateShortAlphaId_1.default)(); static async importsTheCorrectPath() { await this.go.initGoProject(); await this.createSchema(); const dir = 'pgk'; spruce_skill_utils_1.diskUtil.createDir(this.resolvePath(dir)); this.cwd = this.resolvePath(dir); this.setCwd(this.cwd); const results = await this.Action('schema', 'sync', { shouldAutoHandleDependencies: true, }).execute({ schemaLookupDir: '../src/', }); test_utils_1.assert.isFalsy(results.errors, 'Expected no errors when syncing schema.'); await this.go.vet(); } static async createSchema() { const results = await this.Action('schema', 'create').execute({ nameReadable: 'A schema i built!', nameCamel: this.schemaNameCamel, }); test_utils_1.assert.isFalsy(results.errors, 'Expected no errors when creating schema.'); } } exports.default = SyncingSchemasInChildDirInGoTest; __decorate([ (0, test_utils_1.test)() ], SyncingSchemasInChildDirInGoTest, "importsTheCorrectPath", null); //# sourceMappingURL=SyncingSchemasInChildDirInGo.test.js.map