Skip to content

Commit

Permalink
fix(repo): register local collections for unit tests (#3207)
Browse files Browse the repository at this point in the history
  • Loading branch information
FrozenPandaz committed Jun 20, 2020
1 parent 06f1ac6 commit 0ab2fc7
Show file tree
Hide file tree
Showing 10 changed files with 75 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/angular/src/utils/testing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ const testRunner = new SchematicTestRunner(
join(__dirname, '../../collection.json')
);

testRunner.registerCollection(
'@nrwl/jest',
join(__dirname, '../../../jest/collection.json')
);

testRunner.registerCollection(
'@nrwl/workspace',
join(__dirname, '../../../workspace/collection.json')
);

testRunner.registerCollection(
'@nrwl/cypress',
join(__dirname, '../../../cypress/collection.json')
Expand Down
5 changes: 5 additions & 0 deletions packages/express/src/utils/testing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ const testRunner = new SchematicTestRunner(
join(__dirname, '../../collection.json')
);

testRunner.registerCollection(
'@nrwl/node',
join(__dirname, '../../../node/collection.json')
);

export function runSchematic(schematicName: string, options: any, tree: Tree) {
return testRunner.runSchematicAsync(schematicName, options, tree).toPromise();
}
Expand Down
5 changes: 5 additions & 0 deletions packages/nest/src/utils/testing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ const testRunner = new SchematicTestRunner(
join(__dirname, '../../collection.json')
);

testRunner.registerCollection(
'@nrwl/node',
join(__dirname, '../../../node/collection.json')
);

export function runSchematic(schematicName: string, options: any, tree: Tree) {
return testRunner.runSchematicAsync(schematicName, options, tree).toPromise();
}
Expand Down
10 changes: 10 additions & 0 deletions packages/next/src/utils/testing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,21 @@ const testRunner = new SchematicTestRunner(
join(__dirname, '../../collection.json')
);

testRunner.registerCollection(
'@nrwl/jest',
join(__dirname, '../../../jest/collection.json')
);

testRunner.registerCollection(
'@nrwl/cypress',
join(__dirname, '../../../cypress/collection.json')
);

testRunner.registerCollection(
'@nrwl/react',
join(__dirname, '../../../react/collection.json')
);

export function runSchematic(schematicName: string, options: any, tree: Tree) {
return testRunner.runSchematicAsync(schematicName, options, tree).toPromise();
}
Expand Down
10 changes: 10 additions & 0 deletions packages/node/src/utils/testing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ const testRunner = new SchematicTestRunner(
join(__dirname, '../../collection.json')
);

testRunner.registerCollection(
'@nrwl/workspace',
join(__dirname, '../../../workspace/collection.json')
);

testRunner.registerCollection(
'@nrwl/jest',
join(__dirname, '../../../jest/collection.json')
);

export function runSchematic(schematicName: string, options: any, tree: Tree) {
return testRunner.runSchematicAsync(schematicName, options, tree).toPromise();
}
Expand Down
10 changes: 10 additions & 0 deletions packages/nx-plugin/src/utils/testing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@ const testRunner = new SchematicTestRunner(
join(__dirname, '../../collection.json')
);

testRunner.registerCollection(
'@nrwl/node',
join(__dirname, '../../../node/collection.json')
);

testRunner.registerCollection(
'@nrwl/jest',
join(__dirname, '../../../jest/collection.json')
);

export function runSchematic<T>(schematicName: string, options: T, tree: Tree) {
return testRunner.runSchematicAsync(schematicName, options, tree).toPromise();
}
Expand Down
5 changes: 5 additions & 0 deletions packages/react/src/utils/testing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ const testRunner = new SchematicTestRunner(
join(__dirname, '../../collection.json')
);

testRunner.registerCollection(
'@nrwl/jest',
join(__dirname, '../../../jest/collection.json')
);

testRunner.registerCollection(
'@nrwl/cypress',
join(__dirname, '../../../cypress/collection.json')
Expand Down
5 changes: 5 additions & 0 deletions packages/storybook/src/utils/testing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ const testRunner = new SchematicTestRunner(
join(__dirname, '../../collection.json')
);

testRunner.registerCollection(
'@nrwl/angular',
join(__dirname, '../../../angular/collection.json')
);

testRunner.registerCollection(
'@nrwl/cypress',
join(__dirname, '../../../cypress/collection.json')
Expand Down
5 changes: 5 additions & 0 deletions packages/web/src/utils/testing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ const testRunner = new SchematicTestRunner(
join(__dirname, '../../collection.json')
);

testRunner.registerCollection(
'@nrwl/jest',
join(__dirname, '../../../jest/collection.json')
);

testRunner.registerCollection(
'@nrwl/cypress',
join(__dirname, '../../../cypress/collection.json')
Expand Down
10 changes: 10 additions & 0 deletions packages/workspace/src/utils/testing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ const testRunner = new SchematicTestRunner(
join(__dirname, '../../collection.json')
);

testRunner.registerCollection(
'@nrwl/jest',
join(__dirname, '../../../jest/collection.json')
);

testRunner.registerCollection(
'@nrwl/cypress',
join(__dirname, '../../../cypress/collection.json')
Expand Down Expand Up @@ -39,6 +44,11 @@ testRunner.registerCollection(
join(__dirname, '../../../nest/collection.json')
);

testRunner.registerCollection(
'@nrwl/web',
join(__dirname, '../../../web/collection.json')
);

const migrationTestRunner = new SchematicTestRunner(
'@nrwl/workspace/migrations',
join(__dirname, '../../migrations.json')
Expand Down

0 comments on commit 0ab2fc7

Please sign in to comment.