FREE Jasmine JavaScript Knowledge Questions and Answers
Which matcher does Jasmine employ to determine whether two values are equal?
To determine whether two values are equal, use the matcher 'toEqual()'.
Which Jasmine function is used to specify a test suite?
To define a test suite with Jasmine, use the "describe()" function.
What is a "fixture" in Jasmine?
During testing, a fixture is a sample input or set of data.
Which Jasmine function is employed in a test specification to simulate asynchronous operations?
The "done()" function in Jasmine can be used to manage asynchronous actions.
What does Jasmine's "beforeEach()" function do?
A common test environment is created by running code before each test specification in a suite using the "beforeEach()" function.
Which Jasmine method does your test specification's assertion use?
To make assertions, utilize Jasmine's expect() function.
Which Jasmine function is used to indicate that a test specification is pending?
Using the 'pending()' function in Jasmine, you can indicate that a test specification is pending.
How does Jasmine test exceptions?
The 'toThrowError()' matcher in Jasmine can be used to test exceptions.
What does Jasmine's spyOn() function accomplish?
To set up a spy that records function calls and their arguments, use the'spyOn()' method.
Which Jasmine function is used to specify a test specification?
In Jasmine, a test specification is defined using the 'it()' function.
What does Jasmine's "matcher" mean?
In a test, a matcher function in Jasmine compares the actual and expected values.