UNPKG

@flowaccount/nx-aws-cdk

Version:

aws-cdk executors and generators for nx workspace

42 lines 1.89 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.runSchematic = void 0; const path_1 = require("path"); const testing_1 = require("@angular-devkit/schematics/testing"); // import { TestingArchitectHost } from '@angular-devkit/architect/testing'; // import { schema } from '@angular-devkit/core'; // import { Architect } from '@angular-devkit/architect'; // import { MockBuilderContext } from '@nx/workspace/testing'; const testRunner = new testing_1.SchematicTestRunner('@flowaccount/nx-aws-cdk', (0, path_1.join)(__dirname, '../../collection.json')); function runSchematic(schematicName, options, tree) { return testRunner.runSchematic(schematicName, options, tree); } exports.runSchematic = runSchematic; // export function runExternalSchematic( // packageName, // schematicName: string, // options: any, // tree: Tree // ) { // return testRunner // .runExternalSchematicAsync(packageName, schematicName, options, tree) // .toPromise(); // } // export function callRule(rule: Rule, tree: Tree) { // return testRunner.callRule(rule, tree).toPromise(); // } // export async function getTestArchitect() { // const architectHost = new TestingArchitectHost('/root', '/root'); // const registry = new schema.CoreSchemaRegistry(); // registry.addPostTransform(schema.transforms.addUndefinedDefaults); // const architect = new Architect(architectHost, registry); // await architectHost.addBuilderFromPackage(join(__dirname, '../..')); // return [architect, architectHost] as [Architect, TestingArchitectHost]; // } // export async function getMockContext() { // const [architect, architectHost] = await getTestArchitect(); // const context = new MockBuilderContext(architect, architectHost); // await context.addBuilderFromPackage(join(__dirname, '../..')); // return context; // } //# sourceMappingURL=testing.js.map