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.tsThe above command will run the tests for that specific file added in –include argument.