Where should unit tests live in an angularJS application? Code Answer

Hello Developer, Hope you guys are doing great. Today at Tutorial Guruji Official website, we are sharing the answer of Where should unit tests live in an angularJS application? without wasting too much if your time.

The question is published on by Tutorial Guruji team.

I’m trying to stick to the pure angular recommendations for unit testing:

https://docs.angularjs.org/guide/unit-testing

But it really doesn’t tell me where they should live. My guess would be inside an angular service, probably segregated by page or in the same file as the base controller, sort of a base testing factory or service.

Answer

If you use the CLI to create your app and new objects, it will automatically create all of the tests as separate files with the .spec.ts extension.
So if the CLI does it that way, that is probably the recommended way.

We are here to answer your question about Where should unit tests live in an angularJS application? - If you find the proper solution, please don't forgot to share this with your team members.

Related Posts

Tutorial Guruji