UNPKG

@sprucelabs/spruce-cli

Version:

Command line interface for building Spruce skills.

19 lines 912 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const path_1 = __importDefault(require("path")); const AbstractWriter_1 = __importDefault(require("../../../writers/AbstractWriter")); class TestWriter extends AbstractWriter_1.default { async writeTest(destinationDir, options) { const { namePascal } = options; const filename = `${namePascal}.test.ts`; const resolvedDestination = path_1.default.join(destinationDir, filename); const testContent = this.templates.test(options); const results = await this.writeFileIfChangedMixinResults(resolvedDestination, testContent, `Your ${options.type} test.`); return results; } } exports.default = TestWriter; //# sourceMappingURL=TestWriter.js.map