cleanup(core): remove testing utils (#16274)

This commit is contained in:
Colum Ferry 2023-04-12 21:03:10 +01:00 committed by GitHub
parent cafb49ac84
commit dc8711d817
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 72 deletions

View File

@ -1,71 +0,0 @@
import { join } from 'path';
import { SchematicTestRunner } from '@angular-devkit/schematics/testing';
import type { Rule, Tree } from '@angular-devkit/schematics';
const testRunner = new SchematicTestRunner(
'@nrwl/workspace',
join(__dirname, '../../generators.json')
);
testRunner.registerCollection(
'@nrwl/jest',
join(__dirname, '../../../jest/generators.json')
);
testRunner.registerCollection(
'@nrwl/cypress',
join(__dirname, '../../../cypress/generators.json')
);
testRunner.registerCollection(
'@nrwl/express',
join(__dirname, '../../../express/generators.json')
);
testRunner.registerCollection(
'@nrwl/react',
join(__dirname, '../../../react/generators.json')
);
testRunner.registerCollection(
'@nrwl/angular',
join(__dirname, '../../../angular/generators.json')
);
testRunner.registerCollection(
'@nrwl/next',
join(__dirname, '../../../next/generators.json')
);
testRunner.registerCollection(
'@nrwl/node',
join(__dirname, '../../../node/generators.json')
);
testRunner.registerCollection(
'@nrwl/nest',
join(__dirname, '../../../nest/generators.json')
);
testRunner.registerCollection(
'@nrwl/web',
join(__dirname, '../../../web/generators.json')
);
/**
* @deprecated This will be removed in v17. Prefer writing Nx Generators with @nrwl/devkit. Generators can be tested by simply calling them in it().
*/
export function runSchematic<T extends object = any>(
schematicName: string,
options: T,
tree: Tree
) {
return testRunner.runSchematicAsync(schematicName, options, tree).toPromise();
}
/**
* @deprecated This will be removed in v17. Prefer writing Nx Generators with @nrwl/devkit. Generators can be tested by simply calling them in it().
*/
export function callRule(rule: Rule, tree: Tree) {
return testRunner.callRule(rule, tree).toPromise();
}

View File

@ -3,4 +3,3 @@ export {
getFileContent, getFileContent,
MockBuilderContext, MockBuilderContext,
} from './src/utils/testing-utils'; } from './src/utils/testing-utils';
export { callRule, runSchematic } from './src/utils/testing';