@@ -4,6 +4,7 @@ getJasmineRequireObj().toBeRejected = function(j$) {
|
||||
* @function
|
||||
* @async
|
||||
* @name async-matchers#toBeRejected
|
||||
* @since 3.1.0
|
||||
* @example
|
||||
* await expectAsync(aPromise).toBeRejected();
|
||||
* @example
|
||||
|
||||
@@ -4,6 +4,7 @@ getJasmineRequireObj().toBeRejectedWith = function(j$) {
|
||||
* @function
|
||||
* @async
|
||||
* @name async-matchers#toBeRejectedWith
|
||||
* @since 3.3.0
|
||||
* @param {Object} expected - Value that the promise is expected to be rejected with
|
||||
* @example
|
||||
* await expectAsync(aPromise).toBeRejectedWith({prop: 'value'});
|
||||
|
||||
@@ -4,6 +4,7 @@ getJasmineRequireObj().toBeRejectedWithError = function(j$) {
|
||||
* @function
|
||||
* @async
|
||||
* @name async-matchers#toBeRejectedWithError
|
||||
* @since 3.5.0
|
||||
* @param {Error} [expected] - `Error` constructor the object that was thrown needs to be an instance of. If not provided, `Error` will be used.
|
||||
* @param {RegExp|String} [message] - The message that should be set on the thrown `Error`
|
||||
* @example
|
||||
|
||||
@@ -4,6 +4,7 @@ getJasmineRequireObj().toBeResolved = function(j$) {
|
||||
* @function
|
||||
* @async
|
||||
* @name async-matchers#toBeResolved
|
||||
* @since 3.1.0
|
||||
* @example
|
||||
* await expectAsync(aPromise).toBeResolved();
|
||||
* @example
|
||||
|
||||
@@ -4,6 +4,7 @@ getJasmineRequireObj().toBeResolvedTo = function(j$) {
|
||||
* @function
|
||||
* @async
|
||||
* @name async-matchers#toBeResolvedTo
|
||||
* @since 3.1.0
|
||||
* @param {Object} expected - Value that the promise is expected to resolve to
|
||||
* @example
|
||||
* await expectAsync(aPromise).toBeResolvedTo({prop: 'value'});
|
||||
|
||||
@@ -3,6 +3,7 @@ getJasmineRequireObj().nothing = function() {
|
||||
* {@link expect} nothing explicitly.
|
||||
* @function
|
||||
* @name matchers#nothing
|
||||
* @since 2.8.0
|
||||
* @example
|
||||
* expect().nothing();
|
||||
*/
|
||||
|
||||
@@ -3,6 +3,7 @@ getJasmineRequireObj().toBe = function(j$) {
|
||||
* {@link expect} the actual value to be `===` to the expected value.
|
||||
* @function
|
||||
* @name matchers#toBe
|
||||
* @since 1.3.0
|
||||
* @param {Object} expected - The expected value to compare against.
|
||||
* @example
|
||||
* expect(thing).toBe(realThing);
|
||||
|
||||
@@ -3,6 +3,7 @@ getJasmineRequireObj().toBeCloseTo = function() {
|
||||
* {@link expect} the actual value to be within a specified precision of the expected value.
|
||||
* @function
|
||||
* @name matchers#toBeCloseTo
|
||||
* @since 1.3.0
|
||||
* @param {Object} expected - The expected value to compare against.
|
||||
* @param {Number} [precision=2] - The number of decimal points to check.
|
||||
* @example
|
||||
|
||||
@@ -3,6 +3,7 @@ getJasmineRequireObj().toBeDefined = function() {
|
||||
* {@link expect} the actual value to be defined. (Not `undefined`)
|
||||
* @function
|
||||
* @name matchers#toBeDefined
|
||||
* @since 1.3.0
|
||||
* @example
|
||||
* expect(result).toBeDefined();
|
||||
*/
|
||||
|
||||
@@ -3,6 +3,7 @@ getJasmineRequireObj().toBeFalse = function() {
|
||||
* {@link expect} the actual value to be `false`.
|
||||
* @function
|
||||
* @name matchers#toBeFalse
|
||||
* @since 3.5.0
|
||||
* @example
|
||||
* expect(result).toBeFalse();
|
||||
*/
|
||||
|
||||
@@ -3,6 +3,7 @@ getJasmineRequireObj().toBeFalsy = function() {
|
||||
* {@link expect} the actual value to be falsy
|
||||
* @function
|
||||
* @name matchers#toBeFalsy
|
||||
* @since 2.0.0
|
||||
* @example
|
||||
* expect(result).toBeFalsy();
|
||||
*/
|
||||
|
||||
@@ -3,6 +3,7 @@ getJasmineRequireObj().toBeGreaterThan = function() {
|
||||
* {@link expect} the actual value to be greater than the expected value.
|
||||
* @function
|
||||
* @name matchers#toBeGreaterThan
|
||||
* @since 2.0.0
|
||||
* @param {Number} expected - The value to compare against.
|
||||
* @example
|
||||
* expect(result).toBeGreaterThan(3);
|
||||
|
||||
@@ -3,6 +3,7 @@ getJasmineRequireObj().toBeGreaterThanOrEqual = function() {
|
||||
* {@link expect} the actual value to be greater than or equal to the expected value.
|
||||
* @function
|
||||
* @name matchers#toBeGreaterThanOrEqual
|
||||
* @since 2.0.0
|
||||
* @param {Number} expected - The expected value to compare against.
|
||||
* @example
|
||||
* expect(result).toBeGreaterThanOrEqual(25);
|
||||
|
||||
@@ -5,6 +5,7 @@ getJasmineRequireObj().toBeInstanceOf = function(j$) {
|
||||
* {@link expect} the actual to be an instance of the expected class
|
||||
* @function
|
||||
* @name matchers#toBeInstanceOf
|
||||
* @since 3.5.0
|
||||
* @param {Object} expected - The class or constructor function to check for
|
||||
* @example
|
||||
* expect('foo').toBeInstanceOf(String);
|
||||
|
||||
@@ -3,6 +3,7 @@ getJasmineRequireObj().toBeLessThan = function() {
|
||||
* {@link expect} the actual value to be less than the expected value.
|
||||
* @function
|
||||
* @name matchers#toBeLessThan
|
||||
* @since 2.0.0
|
||||
* @param {Number} expected - The expected value to compare against.
|
||||
* @example
|
||||
* expect(result).toBeLessThan(0);
|
||||
|
||||
@@ -3,6 +3,7 @@ getJasmineRequireObj().toBeLessThanOrEqual = function() {
|
||||
* {@link expect} the actual value to be less than or equal to the expected value.
|
||||
* @function
|
||||
* @name matchers#toBeLessThanOrEqual
|
||||
* @since 2.0.0
|
||||
* @param {Number} expected - The expected value to compare against.
|
||||
* @example
|
||||
* expect(result).toBeLessThanOrEqual(123);
|
||||
|
||||
@@ -3,6 +3,7 @@ getJasmineRequireObj().toBeNaN = function(j$) {
|
||||
* {@link expect} the actual value to be `NaN` (Not a Number).
|
||||
* @function
|
||||
* @name matchers#toBeNaN
|
||||
* @since 1.3.0
|
||||
* @example
|
||||
* expect(thing).toBeNaN();
|
||||
*/
|
||||
|
||||
@@ -3,6 +3,7 @@ getJasmineRequireObj().toBeNegativeInfinity = function(j$) {
|
||||
* {@link expect} the actual value to be `-Infinity` (-infinity).
|
||||
* @function
|
||||
* @name matchers#toBeNegativeInfinity
|
||||
* @since 2.6.0
|
||||
* @example
|
||||
* expect(thing).toBeNegativeInfinity();
|
||||
*/
|
||||
|
||||
@@ -3,6 +3,7 @@ getJasmineRequireObj().toBeNull = function() {
|
||||
* {@link expect} the actual value to be `null`.
|
||||
* @function
|
||||
* @name matchers#toBeNull
|
||||
* @since 1.3.0
|
||||
* @example
|
||||
* expect(result).toBeNull();
|
||||
*/
|
||||
|
||||
@@ -3,6 +3,7 @@ getJasmineRequireObj().toBePositiveInfinity = function(j$) {
|
||||
* {@link expect} the actual value to be `Infinity` (infinity).
|
||||
* @function
|
||||
* @name matchers#toBePositiveInfinity
|
||||
* @since 2.6.0
|
||||
* @example
|
||||
* expect(thing).toBePositiveInfinity();
|
||||
*/
|
||||
|
||||
@@ -3,6 +3,7 @@ getJasmineRequireObj().toBeTrue = function() {
|
||||
* {@link expect} the actual value to be `true`.
|
||||
* @function
|
||||
* @name matchers#toBeTrue
|
||||
* @since 3.5.0
|
||||
* @example
|
||||
* expect(result).toBeTrue();
|
||||
*/
|
||||
|
||||
@@ -3,6 +3,7 @@ getJasmineRequireObj().toBeTruthy = function() {
|
||||
* {@link expect} the actual value to be truthy.
|
||||
* @function
|
||||
* @name matchers#toBeTruthy
|
||||
* @since 2.0.0
|
||||
* @example
|
||||
* expect(thing).toBeTruthy();
|
||||
*/
|
||||
|
||||
@@ -3,6 +3,7 @@ getJasmineRequireObj().toBeUndefined = function() {
|
||||
* {@link expect} the actual value to be `undefined`.
|
||||
* @function
|
||||
* @name matchers#toBeUndefined
|
||||
* @since 1.3.0
|
||||
* @example
|
||||
* expect(result).toBeUndefined():
|
||||
*/
|
||||
|
||||
@@ -3,6 +3,7 @@ getJasmineRequireObj().toContain = function() {
|
||||
* {@link expect} the actual value to contain a specific value.
|
||||
* @function
|
||||
* @name matchers#toContain
|
||||
* @since 2.0.0
|
||||
* @param {Object} expected - The value to look for.
|
||||
* @example
|
||||
* expect(array).toContain(anElement);
|
||||
|
||||
@@ -3,6 +3,7 @@ getJasmineRequireObj().toEqual = function(j$) {
|
||||
* {@link expect} the actual value to be equal to the expected, using deep equality comparison.
|
||||
* @function
|
||||
* @name matchers#toEqual
|
||||
* @since 1.3.0
|
||||
* @param {Object} expected - Expected value
|
||||
* @example
|
||||
* expect(bigObject).toEqual({"foo": ['bar', 'baz']});
|
||||
|
||||
@@ -6,6 +6,7 @@ getJasmineRequireObj().toHaveBeenCalled = function(j$) {
|
||||
* {@link expect} the actual (a {@link Spy}) to have been called.
|
||||
* @function
|
||||
* @name matchers#toHaveBeenCalled
|
||||
* @since 1.3.0
|
||||
* @example
|
||||
* expect(mySpy).toHaveBeenCalled();
|
||||
* expect(mySpy).not.toHaveBeenCalled();
|
||||
|
||||
@@ -6,6 +6,7 @@ getJasmineRequireObj().toHaveBeenCalledBefore = function(j$) {
|
||||
* {@link expect} the actual value (a {@link Spy}) to have been called before another {@link Spy}.
|
||||
* @function
|
||||
* @name matchers#toHaveBeenCalledBefore
|
||||
* @since 2.6.0
|
||||
* @param {Spy} expected - {@link Spy} that should have been called after the `actual` {@link Spy}.
|
||||
* @example
|
||||
* expect(mySpy).toHaveBeenCalledBefore(otherSpy);
|
||||
|
||||
@@ -6,6 +6,7 @@ getJasmineRequireObj().toHaveBeenCalledTimes = function(j$) {
|
||||
* {@link expect} the actual (a {@link Spy}) to have been called the specified number of times.
|
||||
* @function
|
||||
* @name matchers#toHaveBeenCalledTimes
|
||||
* @since 2.4.0
|
||||
* @param {Number} expected - The number of invocations to look for.
|
||||
* @example
|
||||
* expect(mySpy).toHaveBeenCalledTimes(3);
|
||||
|
||||
@@ -6,6 +6,7 @@ getJasmineRequireObj().toHaveBeenCalledWith = function(j$) {
|
||||
* {@link expect} the actual (a {@link Spy}) to have been called with particular arguments at least once.
|
||||
* @function
|
||||
* @name matchers#toHaveBeenCalledWith
|
||||
* @since 1.3.0
|
||||
* @param {...Object} - The arguments to look for
|
||||
* @example
|
||||
* expect(mySpy).toHaveBeenCalledWith('foo', 'bar', 2);
|
||||
|
||||
@@ -3,6 +3,7 @@ getJasmineRequireObj().toHaveClass = function(j$) {
|
||||
* {@link expect} the actual value to be a DOM element that has the expected class
|
||||
* @function
|
||||
* @name matchers#toHaveClass
|
||||
* @since 3.0.0
|
||||
* @param {Object} expected - The class name to test for
|
||||
* @example
|
||||
* var el = document.createElement('div');
|
||||
|
||||
@@ -6,6 +6,7 @@ getJasmineRequireObj().toMatch = function(j$) {
|
||||
* {@link expect} the actual value to match a regular expression
|
||||
* @function
|
||||
* @name matchers#toMatch
|
||||
* @since 1.3.0
|
||||
* @param {RegExp|String} expected - Value to look for in the string.
|
||||
* @example
|
||||
* expect("my string").toMatch(/string$/);
|
||||
|
||||
@@ -6,6 +6,7 @@ getJasmineRequireObj().toThrow = function(j$) {
|
||||
* {@link expect} a function to `throw` something.
|
||||
* @function
|
||||
* @name matchers#toThrow
|
||||
* @since 2.0.0
|
||||
* @param {Object} [expected] - Value that should be thrown. If not provided, simply the fact that something was thrown will be checked.
|
||||
* @example
|
||||
* expect(function() { return 'things'; }).toThrow('foo');
|
||||
|
||||
@@ -6,6 +6,7 @@ getJasmineRequireObj().toThrowError = function(j$) {
|
||||
* {@link expect} a function to `throw` an `Error`.
|
||||
* @function
|
||||
* @name matchers#toThrowError
|
||||
* @since 2.0.0
|
||||
* @param {Error} [expected] - `Error` constructor the object that was thrown needs to be an instance of. If not provided, `Error` will be used.
|
||||
* @param {RegExp|String} [message] - The message that should be set on the thrown `Error`
|
||||
* @example
|
||||
|
||||
@@ -5,6 +5,7 @@ getJasmineRequireObj().toThrowMatching = function(j$) {
|
||||
* {@link expect} a function to `throw` something matching a predicate.
|
||||
* @function
|
||||
* @name matchers#toThrowMatching
|
||||
* @since 3.0.0
|
||||
* @param {Function} predicate - A function that takes the thrown exception as its parameter and returns true if it matches.
|
||||
* @example
|
||||
* expect(function() { throw new Error('nope'); }).toThrowMatching(function(thrown) { return thrown.message === 'nope'; });
|
||||
|
||||
Reference in New Issue
Block a user