Skip to content

Commit 2a773e2

Browse files
committed
feat: support ng-add schematic
1 parent d64ff4c commit 2a773e2

File tree

5 files changed

+34
-0
lines changed

5 files changed

+34
-0
lines changed

projects/testing-library/package.json

+4
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121
"url": "https://github.com/testing-library/angular-testing-library/issues"
2222
},
2323
"homepage": "https://github.com/testing-library/angular-testing-library#readme",
24+
"schematics": "./schematics/collection.json",
25+
"ng-add": {
26+
"save": "devDependencies"
27+
},
2428
"ng-update": {
2529
"migrations": "./schematics/migrations/migration.json"
2630
},
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"schematics": {
3+
"ng-add": {
4+
"aliases": ["init"],
5+
"factory": "./ng-add",
6+
"schema": "./ng-add/schema.json",
7+
"description": "Add @testing-library/angular to your application"
8+
}
9+
}
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { Rule, SchematicContext, Tree } from '@angular-devkit/schematics';
2+
3+
export default function (): Rule {
4+
return (_host: Tree, context: SchematicContext) => {
5+
context.logger.info(
6+
`Correctly installed @testing-library/angular.
7+
See our docs at https://testing-library.com/docs/angular-testing-library/intro/ to get started.`,
8+
);
9+
};
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"$schema": "http://json-schema.org/schema",
3+
"$id": "SchematicsTestingLibraryAngular",
4+
"title": "testing-library-anguular",
5+
"type": "object",
6+
"properties": {},
7+
"required": []
8+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// eslint-disable-next-line @typescript-eslint/no-empty-interface
2+
export interface Schema {}

0 commit comments

Comments
 (0)