The common convention we have for naming the file for our test is a file that is suffixed with spec.ts. So, if you have a file named homepage.component.ts, your test file will be named homepage.component.spec.ts.
Karma does not use the filenaming conventions to find the test cases, it just scans through all the transpiled files and executes the test cases it finds in any file. This naming convention is specifically for us to manage our code in a more logical fashion.
As we are using the Angular CLI, it creates the respective test file when we generate a component or a service with the same naming convention. So, if we look at our current folder structure, you will see the files with names as *.spec.ts in your respective folders, as shown in the following screenshot:
