UNPKG

1.06 kBJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.runMigration = exports.callRule = exports.runSchematic = void 0;
4const path_1 = require("path");
5const testing_1 = require("@angular-devkit/schematics/testing");
6const testRunner = new testing_1.SchematicTestRunner('@nrwl/jest', (0, path_1.join)(__dirname, '../../generators.json'));
7const migrationTestRunner = new testing_1.SchematicTestRunner('@nrwl/jest/migrations', (0, path_1.join)(__dirname, '../../migrations.json'));
8function runSchematic(schematicName, options, tree) {
9 return testRunner
10 .runSchematicAsync(schematicName, options, tree)
11 .toPromise();
12}
13exports.runSchematic = runSchematic;
14function callRule(rule, tree) {
15 return testRunner.callRule(rule, tree).toPromise();
16}
17exports.callRule = callRule;
18function runMigration(migrationName, options, tree) {
19 return migrationTestRunner
20 .runSchematicAsync(migrationName, options, tree)
21 .toPromise();
22}
23exports.runMigration = runMigration;
24//# sourceMappingURL=testing.js.map
\No newline at end of file