About the Karma framework

Karma is a test-runner framework for executing test scripts on a server and generating the reports.

The following is taken from the official website:

"Karma is essentially a tool which spawns a web server that executes source code against test code for each of the browsers connected. The results of each test against each browser are examined and displayed via the command line to the developer such that they can see which browsers and tests passed or failed."

The Karma framework gets added in our list of dependencies as it is included in the Angular CLI installation. Before we proceed to write and execute our test scripts, it's good practice to verify whether we have installed both Jasmine and Karma correctly in our package.json file. We can also verify the version numbers of the libraries that are being used.

I bet you figured out that this is also the place to specify any particular version of Jasmine and Karma you want to use.

In the following screenshot, we can verify that we have added Jasmine and Karma to our list of devDependencies in our package.json file:

Great. Now, it's time to dig deep into Angular testing concepts and write some test scripts.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.12.71.146