What is dot spec `.spec.ts` and why do typescript tests use them?

Viewed 1176

I haven't seen an example where a typescript project doesn't use .spec.ts for their tests.

So why even both putting .spec.ts? What is the purpose of .spec.ts?

1 Answers

Their purpose is to identify test files in Angular applications (among other frameworks). This it not a standard, just a naming convention which allows test files to be in the same folder as the corresponding file to be tested.

Related