2.1.6 • Published 12 months ago

ngx-spec v2.1.6

Weekly downloads
7,648
License
MIT
Repository
github
Last release
12 months ago

ngx-spec

A missing schematic for creating Angular spec.

Works only from @angular/cli@^6.0.0 on.

Installation

Angular 7+:

npm i -D ngx-spec@^2.0.0

Angular 6 (only spec, no specs support):

npm i -D ngx-spec@^1.0.0

Supported types

Supported types are

const SupportedTypes = ['component', 'directive', 'guard', 'service', 'pipe'];

ng g ngx:spec

Run:

ng g ngx-spec:spec path/my.service

or

ng g ngx-spec:spec path/my.service.ts

Please note that in a standard Angular CLI project the path will start at src/app. That's why if you use the file paths then it would be comfortable to cd src/app first and then safely use the shell autocompletion to produce the proper path.

ng g ngx-spec:specs

Batch specs generator. Supports minimatch globs. Does not override existing spec files.

Important: the glob should be passed as a string, otherwise OS tries to intercept it with its glob.

Examples:

ng g ngx-spec:specs 'path/*.service.ts'
ng g ngx-spec:specs '**/*.service.ts'
ng g ngx-spec:specs '**/*'

etc.

Please note that in a standard Angular CLI project the path will start at src/app. That's why if you use the file paths then it would be comfortable to cd src/app first and then safely use the shell autocompletion to produce the proper path.

Usage in Visual Studio Code

It could be easier to use the schematic with vscode-angular-schematics extension in Visual Studio Code.

History

See the story behind on stackoverflow and on Angular CLI github issue.

License

MIT

2.1.6

12 months ago

2.1.5

2 years ago

2.1.4

5 years ago

2.1.3

5 years ago

2.1.2

5 years ago

2.1.1

5 years ago

2.1.0

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.0.1

6 years ago

1.0.0

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago