Angular 15 Run a single spec file

If you want to run a single spec file with ng test command then you need to pass the –include argument along with your ng test command.

Example:

ng test --include=**/your.component.spec.ts

The above command will run the tests for that specific file added in –include argument.