What is angular unit testing?
Unit testing is a type of software testing where we test individual components of an application. In AngularJS Unit testing is performed using Jasmine and Karma. Jasmine is the testing framework used for writing the test and Karma is used run tests. We can also use TestBed and async to make testing asynchronous code, components, directives or services easier.
What is Karma and Jasmine?
Karma: Karma is a tool of running tests on browsers it lets us spawn browsers and run jasmine tests inside of them.
Jasmine: It is a testing framework for Javascript programming language that supports Behaviour Driven Development (BDD) software development practice.
How to install Karma using NPM?
After installing Node.js, we can install the Karma test runner by running npm install karma --save-dev command.
Enlist major matchers available in Jasmine?
toBeArray(), toBeArrayOfBooleans(), toBeFalse(), toBeCalculable(), toBeOddNumber(), toBeEmptyObject(), any.after(date) are few built in matchers in Jasmine. For complete list of Jasmine Matchers please visit Github Jasmine Matchers List
0 comments:
Post a Comment