diff --git a/lib/jasmine-core/jasmine.js b/lib/jasmine-core/jasmine.js index 50346ee0..abbd7262 100644 --- a/lib/jasmine-core/jasmine.js +++ b/lib/jasmine-core/jasmine.js @@ -162,6 +162,7 @@ getJasmineRequireObj().base = function(j$, jasmineGlobal) { * Maximum object depth the pretty printer will print to. * Set this to a lower value to speed up pretty printing if you have large objects. * @name jasmine.MAX_PRETTY_PRINT_DEPTH + * @since 1.3.0 */ j$.MAX_PRETTY_PRINT_DEPTH = 8; /** @@ -169,17 +170,20 @@ getJasmineRequireObj().base = function(j$, jasmineGlobal) { * This will also limit the number of keys and values displayed for an object. * Elements past this number will be ellipised. * @name jasmine.MAX_PRETTY_PRINT_ARRAY_LENGTH + * @since 2.7.0 */ j$.MAX_PRETTY_PRINT_ARRAY_LENGTH = 50; /** * Maximum number of characters to display when pretty printing objects. * Characters past this number will be ellipised. * @name jasmine.MAX_PRETTY_PRINT_CHARS + * @since 2.9.0 */ j$.MAX_PRETTY_PRINT_CHARS = 1000; /** * Default number of milliseconds Jasmine will wait for an asynchronous spec to complete. * @name jasmine.DEFAULT_TIMEOUT_INTERVAL + * @since 1.3.0 */ j$.DEFAULT_TIMEOUT_INTERVAL = 5000; @@ -191,6 +195,7 @@ getJasmineRequireObj().base = function(j$, jasmineGlobal) { * Get the currently booted Jasmine Environment. * * @name jasmine.getEnv + * @since 1.3.0 * @function * @return {Env} */ @@ -318,6 +323,7 @@ getJasmineRequireObj().base = function(j$, jasmineGlobal) { * Get a matcher, usable in any {@link matchers|matcher} that uses Jasmine's equality (e.g. {@link matchers#toEqual|toEqual}, {@link matchers#toContain|toContain}, or {@link matchers#toHaveBeenCalledWith|toHaveBeenCalledWith}), * that will succeed if the actual value being compared is an instance of the specified class/constructor. * @name jasmine.any + * @since 1.3.0 * @function * @param {Constructor} clazz - The constructor to check against. */ @@ -329,6 +335,7 @@ getJasmineRequireObj().base = function(j$, jasmineGlobal) { * Get a matcher, usable in any {@link matchers|matcher} that uses Jasmine's equality (e.g. {@link matchers#toEqual|toEqual}, {@link matchers#toContain|toContain}, or {@link matchers#toHaveBeenCalledWith|toHaveBeenCalledWith}), * that will succeed if the actual value being compared is not `null` and not `undefined`. * @name jasmine.anything + * @since 2.2.0 * @function */ j$.anything = function() { @@ -339,6 +346,7 @@ getJasmineRequireObj().base = function(j$, jasmineGlobal) { * Get a matcher, usable in any {@link matchers|matcher} that uses Jasmine's equality (e.g. {@link matchers#toEqual|toEqual}, {@link matchers#toContain|toContain}, or {@link matchers#toHaveBeenCalledWith|toHaveBeenCalledWith}), * that will succeed if the actual value being compared is `true` or anything truthy. * @name jasmine.truthy + * @since 3.1.0 * @function */ j$.truthy = function() { @@ -349,6 +357,7 @@ getJasmineRequireObj().base = function(j$, jasmineGlobal) { * Get a matcher, usable in any {@link matchers|matcher} that uses Jasmine's equality (e.g. {@link matchers#toEqual|toEqual}, {@link matchers#toContain|toContain}, or {@link matchers#toHaveBeenCalledWith|toHaveBeenCalledWith}), * that will succeed if the actual value being compared is `null`, `undefined`, `0`, `false` or anything falsey. * @name jasmine.falsy + * @since 3.1.0 * @function */ j$.falsy = function() { @@ -359,6 +368,7 @@ getJasmineRequireObj().base = function(j$, jasmineGlobal) { * Get a matcher, usable in any {@link matchers|matcher} that uses Jasmine's equality (e.g. {@link matchers#toEqual|toEqual}, {@link matchers#toContain|toContain}, or {@link matchers#toHaveBeenCalledWith|toHaveBeenCalledWith}), * that will succeed if the actual value being compared is empty. * @name jasmine.empty + * @since 3.1.0 * @function */ j$.empty = function() { @@ -369,6 +379,7 @@ getJasmineRequireObj().base = function(j$, jasmineGlobal) { * Get a matcher, usable in any {@link matchers|matcher} that uses Jasmine's equality (e.g. {@link matchers#toEqual|toEqual}, {@link matchers#toContain|toContain}, or {@link matchers#toHaveBeenCalledWith|toHaveBeenCalledWith}), * that will succeed if the actual value being compared is not empty. * @name jasmine.notEmpty + * @since 3.1.0 * @function */ j$.notEmpty = function() { @@ -379,6 +390,7 @@ getJasmineRequireObj().base = function(j$, jasmineGlobal) { * Get a matcher, usable in any {@link matchers|matcher} that uses Jasmine's equality (e.g. {@link matchers#toEqual|toEqual}, {@link matchers#toContain|toContain}, or {@link matchers#toHaveBeenCalledWith|toHaveBeenCalledWith}), * that will succeed if the actual value being compared contains at least the keys and values. * @name jasmine.objectContaining + * @since 1.3.0 * @function * @param {Object} sample - The subset of properties that _must_ be in the actual. */ @@ -390,6 +402,7 @@ getJasmineRequireObj().base = function(j$, jasmineGlobal) { * Get a matcher, usable in any {@link matchers|matcher} that uses Jasmine's equality (e.g. {@link matchers#toEqual|toEqual}, {@link matchers#toContain|toContain}, or {@link matchers#toHaveBeenCalledWith|toHaveBeenCalledWith}), * that will succeed if the actual value is a `String` that matches the `RegExp` or `String`. * @name jasmine.stringMatching + * @since 2.2.0 * @function * @param {RegExp|String} expected */ @@ -401,6 +414,7 @@ getJasmineRequireObj().base = function(j$, jasmineGlobal) { * Get a matcher, usable in any {@link matchers|matcher} that uses Jasmine's equality (e.g. {@link matchers#toEqual|toEqual}, {@link matchers#toContain|toContain}, or {@link matchers#toHaveBeenCalledWith|toHaveBeenCalledWith}), * that will succeed if the actual value is an `Array` that contains at least the elements in the sample. * @name jasmine.arrayContaining + * @since 2.2.0 * @function * @param {Array} sample */ @@ -412,6 +426,7 @@ getJasmineRequireObj().base = function(j$, jasmineGlobal) { * Get a matcher, usable in any {@link matchers|matcher} that uses Jasmine's equality (e.g. {@link matchers#toEqual|toEqual}, {@link matchers#toContain|toContain}, or {@link matchers#toHaveBeenCalledWith|toHaveBeenCalledWith}), * that will succeed if the actual value is an `Array` that contains all of the elements in the sample in any order. * @name jasmine.arrayWithExactContents + * @since 2.8.0 * @function * @param {Array} sample */ @@ -842,6 +857,7 @@ getJasmineRequireObj().Env = function(j$) { /** * _Note:_ Do not construct this directly, Jasmine will make one during booting. * @name Env + * @since 2.0.0 * @classdesc The Jasmine environment * @constructor */ @@ -876,11 +892,13 @@ getJasmineRequireObj().Env = function(j$) { * This represents the available options to configure Jasmine. * Options that are not provided will use their default values * @interface Configuration + * @since 3.3.0 */ var config = { /** * Whether to randomize spec execution order * @name Configuration#random + * @since 3.3.0 * @type Boolean * @default true */ @@ -889,6 +907,7 @@ getJasmineRequireObj().Env = function(j$) { * Seed to use as the basis of randomization. * Null causes the seed to be determined randomly at the start of execution. * @name Configuration#seed + * @since 3.3.0 * @type function * @default null */ @@ -896,6 +915,7 @@ getJasmineRequireObj().Env = function(j$) { /** * Whether to stop execution of the suite after the first spec failure * @name Configuration#failFast + * @since 3.3.0 * @type Boolean * @default false */ @@ -903,6 +923,7 @@ getJasmineRequireObj().Env = function(j$) { /** * Whether to cause specs to only have one expectation failure. * @name Configuration#oneFailurePerSpec + * @since 3.3.0 * @type Boolean * @default false */ @@ -910,6 +931,7 @@ getJasmineRequireObj().Env = function(j$) { /** * Function to use to filter specs * @name Configuration#specFilter + * @since 3.3.0 * @type function * @default true */ @@ -920,6 +942,7 @@ getJasmineRequireObj().Env = function(j$) { * Whether or not reporters should hide disabled specs from their output. * Currently only supported by Jasmine's HTMLReporter * @name Configuration#hideDisabled + * @since 3.3.0 * @type Boolean * @default false */ @@ -929,6 +952,7 @@ getJasmineRequireObj().Env = function(j$) { * to create a promise. If not set, it will default to whatever global Promise * library is available (if any). * @name Configuration#Promise + * @since 3.5.0 * @type function * @default undefined */ @@ -977,6 +1001,7 @@ getJasmineRequireObj().Env = function(j$) { /** * Configure your jasmine environment * @name Env#configure + * @since 3.3.0 * @argument {Configuration} configuration * @function */ @@ -1022,6 +1047,7 @@ getJasmineRequireObj().Env = function(j$) { /** * Get the current configuration for your jasmine environment * @name Env#configuration + * @since 3.3.0 * @function * @returns {Configuration} */ @@ -1189,6 +1215,7 @@ getJasmineRequireObj().Env = function(j$) { * Sets whether Jasmine should throw an Error when an expectation fails. * This causes a spec to only have one expectation failure. * @name Env#throwOnExpectationFailure + * @since 2.3.0 * @function * @param {Boolean} value Whether to throw when a expectation fails * @deprecated Use the `oneFailurePerSpec` option with {@link Env#configure} @@ -1210,6 +1237,7 @@ getJasmineRequireObj().Env = function(j$) { /** * Set whether to stop suite execution when a spec fails * @name Env#stopOnSpecFailure + * @since 2.7.0 * @function * @param {Boolean} value Whether to stop suite execution when a spec fails * @deprecated Use the `failFast` option with {@link Env#configure} @@ -1231,6 +1259,7 @@ getJasmineRequireObj().Env = function(j$) { /** * Set whether to randomize test execution order * @name Env#randomizeTests + * @since 2.4.0 * @function * @param {Boolean} value Whether to randomize execution order * @deprecated Use the `random` option with {@link Env#configure} @@ -1252,6 +1281,7 @@ getJasmineRequireObj().Env = function(j$) { /** * Set the random number seed for spec randomization * @name Env#seed + * @since 2.4.0 * @function * @param {Number} value The seed value * @deprecated Use the `seed` option with {@link Env#configure} @@ -1275,6 +1305,7 @@ getJasmineRequireObj().Env = function(j$) { /** * @name Env#hideDisabled + * @since 3.2.0 * @function */ this.hideDisabled = function(value) { @@ -1522,6 +1553,7 @@ getJasmineRequireObj().Env = function(j$) { /** * Add a custom reporter to the Jasmine environment. * @name Env#addReporter + * @since 2.0.0 * @function * @param {Reporter} reporterToAdd The reporter to be added. * @see custom_reporter @@ -1533,6 +1565,7 @@ getJasmineRequireObj().Env = function(j$) { /** * Provide a fallback reporter if no other reporters have been specified. * @name Env#provideFallbackReporter + * @since 2.5.0 * @function * @param {Reporter} reporterToAdd The reporter * @see custom_reporter @@ -1544,6 +1577,7 @@ getJasmineRequireObj().Env = function(j$) { /** * Clear all registered reporters * @name Env#clearReporters + * @since 2.5.2 * @function */ this.clearReporters = function() { @@ -1946,6 +1980,7 @@ getJasmineRequireObj().JsApiReporter = function(j$) { /** * Get the current status for the Jasmine environment. * @name jsApiReporter#status + * @since 2.0.0 * @function * @return {String} - One of `loaded`, `started`, or `done` */ @@ -1969,6 +2004,7 @@ getJasmineRequireObj().JsApiReporter = function(j$) { * * Retrievable in slices for easier serialization. * @name jsApiReporter#suiteResults + * @since 2.1.0 * @function * @param {Number} index - The position in the suites list to start from. * @param {Number} length - Maximum number of suite results to return. @@ -1986,6 +2022,7 @@ getJasmineRequireObj().JsApiReporter = function(j$) { /** * Get all of the suites in a single object, with their `id` as the key. * @name jsApiReporter#suites + * @since 2.0.0 * @function * @return {Object} - Map of suite id to {@link SuiteResult} */ @@ -2004,6 +2041,7 @@ getJasmineRequireObj().JsApiReporter = function(j$) { * * Retrievable in slices for easier serialization. * @name jsApiReporter#specResults + * @since 2.0.0 * @function * @param {Number} index - The position in the specs list to start from. * @param {Number} length - Maximum number of specs results to return. @@ -2016,6 +2054,7 @@ getJasmineRequireObj().JsApiReporter = function(j$) { /** * Get all spec results. * @name jsApiReporter#specs + * @since 2.0.0 * @function * @return {SpecResult[]} */ @@ -2026,6 +2065,7 @@ getJasmineRequireObj().JsApiReporter = function(j$) { /** * Get the number of milliseconds it took for the full Jasmine suite to run. * @name jsApiReporter#executionTime + * @since 2.0.0 * @function * @return {Number} */ @@ -2318,6 +2358,7 @@ getJasmineRequireObj().Truthy = function(j$) { getJasmineRequireObj().CallTracker = function(j$) { /** * @namespace Spy#calls + * @since 2.0.0 */ function CallTracker() { var calls = []; @@ -2333,6 +2374,7 @@ getJasmineRequireObj().CallTracker = function(j$) { /** * Check whether this spy has been invoked. * @name Spy#calls#any + * @since 2.0.0 * @function * @return {Boolean} */ @@ -2343,6 +2385,7 @@ getJasmineRequireObj().CallTracker = function(j$) { /** * Get the number of invocations of this spy. * @name Spy#calls#count + * @since 2.0.0 * @function * @return {Integer} */ @@ -2353,6 +2396,7 @@ getJasmineRequireObj().CallTracker = function(j$) { /** * Get the arguments that were passed to a specific invocation of this spy. * @name Spy#calls#argsFor + * @since 2.0.0 * @function * @param {Integer} index The 0-based invocation index. * @return {Array} @@ -2365,6 +2409,7 @@ getJasmineRequireObj().CallTracker = function(j$) { /** * Get the raw calls array for this spy. * @name Spy#calls#all + * @since 2.0.0 * @function * @return {Spy.callData[]} */ @@ -2375,6 +2420,7 @@ getJasmineRequireObj().CallTracker = function(j$) { /** * Get all of the arguments for each invocation of this spy in the order they were received. * @name Spy#calls#allArgs + * @since 2.0.0 * @function * @return {Array} */ @@ -2390,6 +2436,7 @@ getJasmineRequireObj().CallTracker = function(j$) { /** * Get the first invocation of this spy. * @name Spy#calls#first + * @since 2.0.0 * @function * @return {ObjecSpy.callData} */ @@ -2400,6 +2447,7 @@ getJasmineRequireObj().CallTracker = function(j$) { /** * Get the most recent invocation of this spy. * @name Spy#calls#mostRecent + * @since 2.0.0 * @function * @return {ObjecSpy.callData} */ @@ -2410,6 +2458,7 @@ getJasmineRequireObj().CallTracker = function(j$) { /** * Reset this spy as if it has never been called. * @name Spy#calls#reset + * @since 2.0.0 * @function */ this.reset = function() { @@ -2419,6 +2468,7 @@ getJasmineRequireObj().CallTracker = function(j$) { /** * Set this spy to do a shallow clone of arguments passed to each invocation. * @name Spy#calls#saveArgumentsByValue + * @since 2.5.0 * @function */ this.saveArgumentsByValue = function() { @@ -2534,6 +2584,7 @@ getJasmineRequireObj().Clock = function() { /** * Install the mock clock over the built-in methods. * @name Clock#install + * @since 2.0.0 * @function * @return {Clock} */ @@ -2554,6 +2605,7 @@ getJasmineRequireObj().Clock = function() { /** * Uninstall the mock clock, returning the built-in methods to their places. * @name Clock#uninstall + * @since 2.0.0 * @function */ self.uninstall = function() { @@ -2570,6 +2622,7 @@ getJasmineRequireObj().Clock = function() { * * The clock will be {@link Clock#install|install}ed before the function is called and {@link Clock#uninstall|uninstall}ed in a `finally` after the function completes. * @name Clock#withMock + * @since 2.3.0 * @function * @param {Function} closure The function to be called. */ @@ -2585,6 +2638,7 @@ getJasmineRequireObj().Clock = function() { /** * Instruct the installed Clock to also mock the date returned by `new Date()` * @name Clock#mockDate + * @since 2.1.0 * @function * @param {Date} [initialDate=now] The `Date` to provide. */ @@ -2617,6 +2671,7 @@ getJasmineRequireObj().Clock = function() { /** * Tick the Clock forward, running any enqueued timeouts along the way * @name Clock#tick + * @since 1.3.0 * @function * @param {int} millis The number of milliseconds to tick. */ @@ -3042,6 +3097,7 @@ getJasmineRequireObj().Expectation = function(j$) { * Add some context for an {@link expect} * @function * @name matchers#withContext + * @since 3.3.0 * @param {String} message - Additional context to show when the matcher fails * @return {matchers} */ @@ -3053,6 +3109,7 @@ getJasmineRequireObj().Expectation = function(j$) { * Invert the matcher following this {@link expect} * @member * @name matchers#not + * @since 1.3.0 * @type {matchers} * @example * expect(something).not.toBe(true); @@ -3086,6 +3143,7 @@ getJasmineRequireObj().Expectation = function(j$) { * Add some context for an {@link expectAsync} * @function * @name async-matchers#withContext + * @since 3.3.0 * @param {String} message - Additional context to show when the async matcher fails * @return {async-matchers} */ @@ -3526,6 +3584,7 @@ getJasmineRequireObj().toBeRejected = function(j$) { * @function * @async * @name async-matchers#toBeRejected + * @since 3.1.0 * @example * await expectAsync(aPromise).toBeRejected(); * @example @@ -3549,6 +3608,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'}); @@ -3596,6 +3656,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 @@ -3685,6 +3746,7 @@ getJasmineRequireObj().toBeResolved = function(j$) { * @function * @async * @name async-matchers#toBeResolved + * @since 3.1.0 * @example * await expectAsync(aPromise).toBeResolved(); * @example @@ -3708,6 +3770,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'}); @@ -4259,6 +4322,7 @@ getJasmineRequireObj().nothing = function() { * {@link expect} nothing explicitly. * @function * @name matchers#nothing + * @since 2.8.0 * @example * expect().nothing(); */ @@ -4357,6 +4421,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); @@ -4387,6 +4452,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 @@ -4424,6 +4490,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(); */ @@ -4445,6 +4512,7 @@ getJasmineRequireObj().toBeFalse = function() { * {@link expect} the actual value to be `false`. * @function * @name matchers#toBeFalse + * @since 3.5.0 * @example * expect(result).toBeFalse(); */ @@ -4466,6 +4534,7 @@ getJasmineRequireObj().toBeFalsy = function() { * {@link expect} the actual value to be falsy * @function * @name matchers#toBeFalsy + * @since 2.0.0 * @example * expect(result).toBeFalsy(); */ @@ -4487,6 +4556,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); @@ -4510,6 +4580,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); @@ -4534,6 +4605,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); @@ -4578,6 +4650,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); @@ -4601,6 +4674,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); @@ -4624,6 +4698,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(); */ @@ -4653,6 +4728,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(); */ @@ -4682,6 +4758,7 @@ getJasmineRequireObj().toBeNull = function() { * {@link expect} the actual value to be `null`. * @function * @name matchers#toBeNull + * @since 1.3.0 * @example * expect(result).toBeNull(); */ @@ -4703,6 +4780,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(); */ @@ -4732,6 +4810,7 @@ getJasmineRequireObj().toBeTrue = function() { * {@link expect} the actual value to be `true`. * @function * @name matchers#toBeTrue + * @since 3.5.0 * @example * expect(result).toBeTrue(); */ @@ -4753,6 +4832,7 @@ getJasmineRequireObj().toBeTruthy = function() { * {@link expect} the actual value to be truthy. * @function * @name matchers#toBeTruthy + * @since 2.0.0 * @example * expect(thing).toBeTruthy(); */ @@ -4774,6 +4854,7 @@ getJasmineRequireObj().toBeUndefined = function() { * {@link expect} the actual value to be `undefined`. * @function * @name matchers#toBeUndefined + * @since 1.3.0 * @example * expect(result).toBeUndefined(): */ @@ -4795,6 +4876,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); @@ -4821,6 +4903,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']}); @@ -4856,6 +4939,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(); @@ -4895,6 +4979,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); @@ -4956,6 +5041,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); @@ -4997,6 +5083,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); @@ -5038,6 +5125,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'); @@ -5075,6 +5163,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$/); @@ -5107,6 +5196,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'); @@ -5165,6 +5255,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 @@ -5331,6 +5422,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'; }); @@ -6162,6 +6254,7 @@ getJasmineRequireObj().interface = function(jasmine, env) { * * Calls to `describe` can be nested within other calls to compose your suite as a tree. * @name describe + * @since 1.3.0 * @function * @global * @param {String} description Textual description of the group @@ -6176,6 +6269,7 @@ getJasmineRequireObj().interface = function(jasmine, env) { * * Specs within an `xdescribe` will be marked pending and not executed * @name xdescribe + * @since 1.3.0 * @function * @global * @param {String} description Textual description of the group @@ -6191,6 +6285,7 @@ getJasmineRequireObj().interface = function(jasmine, env) { * If suites or specs are focused, only those that are focused will be executed * @see fit * @name fdescribe + * @since 2.1.0 * @function * @global * @param {String} description Textual description of the group @@ -6205,6 +6300,7 @@ getJasmineRequireObj().interface = function(jasmine, env) { * * A spec whose expectations all succeed will be passing and a spec with any failures will fail. * @name it + * @since 1.3.0 * @function * @global * @param {String} description Textual description of what this spec is checking @@ -6221,6 +6317,7 @@ getJasmineRequireObj().interface = function(jasmine, env) { * * The spec will report as `pending` and will not be executed. * @name xit + * @since 1.3.0 * @function * @global * @param {String} description Textual description of what this spec is checking. @@ -6235,6 +6332,7 @@ getJasmineRequireObj().interface = function(jasmine, env) { * * If suites or specs are focused, only those that are focused will be executed. * @name fit + * @since 2.1.0 * @function * @global * @param {String} description Textual description of what this spec is checking. @@ -6249,6 +6347,7 @@ getJasmineRequireObj().interface = function(jasmine, env) { /** * Run some shared setup before each of the specs in the {@link describe} in which it is called. * @name beforeEach + * @since 1.3.0 * @function * @global * @param {implementationCallback} [function] Function that contains the code to setup your specs. @@ -6262,6 +6361,7 @@ getJasmineRequireObj().interface = function(jasmine, env) { /** * Run some shared teardown after each of the specs in the {@link describe} in which it is called. * @name afterEach + * @since 1.3.0 * @function * @global * @param {implementationCallback} [function] Function that contains the code to teardown your specs. @@ -6277,6 +6377,7 @@ getJasmineRequireObj().interface = function(jasmine, env) { * * _Note:_ Be careful, sharing the setup from a beforeAll makes it easy to accidentally leak state between your specs so that they erroneously pass or fail. * @name beforeAll + * @since 2.1.0 * @function * @global * @param {implementationCallback} [function] Function that contains the code to setup your specs. @@ -6292,6 +6393,7 @@ getJasmineRequireObj().interface = function(jasmine, env) { * * _Note:_ Be careful, sharing the teardown from a afterAll makes it easy to accidentally leak state between your specs so that they erroneously pass or fail. * @name afterAll + * @since 2.1.0 * @function * @global * @param {implementationCallback} [function] Function that contains the code to teardown your specs. @@ -6305,6 +6407,7 @@ getJasmineRequireObj().interface = function(jasmine, env) { /** * Create an expectation for a spec. * @name expect + * @since 1.3.0 * @function * @global * @param {Object} actual - Actual computed value to test expectations against. @@ -6320,6 +6423,7 @@ getJasmineRequireObj().interface = function(jasmine, env) { * which must be either returned from the spec or waited for using `await` * in order for Jasmine to associate them with the correct spec. * @name expectAsync + * @since 3.3.0 * @function * @global * @param {Object} actual - Actual computed value to test expectations against. @@ -6336,6 +6440,7 @@ getJasmineRequireObj().interface = function(jasmine, env) { /** * Mark a spec as pending, expectation results will be ignored. * @name pending + * @since 2.0.0 * @function * @global * @param {String} [message] - Reason the spec is pending. @@ -6347,6 +6452,7 @@ getJasmineRequireObj().interface = function(jasmine, env) { /** * Explicitly mark a spec as failed. * @name fail + * @since 2.1.0 * @function * @global * @param {String|Error} [error] - Reason for the failure. @@ -6358,6 +6464,7 @@ getJasmineRequireObj().interface = function(jasmine, env) { /** * Install a spy onto an existing object. * @name spyOn + * @since 1.3.0 * @function * @global * @param {Object} obj - The object upon which to install the {@link Spy}. @@ -6371,6 +6478,7 @@ getJasmineRequireObj().interface = function(jasmine, env) { /** * Install a spy on a property installed with `Object.defineProperty` onto an existing object. * @name spyOnProperty + * @since 2.6.0 * @function * @global * @param {Object} obj - The object upon which to install the {@link Spy} @@ -6385,6 +6493,7 @@ getJasmineRequireObj().interface = function(jasmine, env) { /** * Installs spies on all writable and configurable properties of an object. * @name spyOnAllFunctions + * @since 3.2.1 * @function * @global * @param {Object} obj - The object upon which to install the {@link Spy}s @@ -6409,6 +6518,7 @@ getJasmineRequireObj().interface = function(jasmine, env) { * * _Note:_ This is only callable from within a {@link beforeEach}, {@link it}, or {@link beforeAll}. * @name jasmine.addCustomEqualityTester + * @since 2.0.0 * @function * @param {Function} tester - A function which takes two arguments to compare and returns a `true` or `false` comparison result if it knows how to compare them, and `undefined` otherwise. * @see custom_equality @@ -6422,6 +6532,7 @@ getJasmineRequireObj().interface = function(jasmine, env) { * * _Note:_ This is only callable from within a {@link beforeEach}, {@link it}, or {@link beforeAll}. * @name jasmine.addMatchers + * @since 2.0.0 * @function * @param {Object} matchers - Keys from this object will be the new matcher names. * @see custom_matcher @@ -6433,6 +6544,7 @@ getJasmineRequireObj().interface = function(jasmine, env) { /** * Get the currently booted mock {Clock} for this Jasmine environment. * @name jasmine.clock + * @since 2.0.0 * @function * @returns {Clock} */ @@ -6443,6 +6555,7 @@ getJasmineRequireObj().interface = function(jasmine, env) { /** * Create a bare {@link Spy} object. This won't be installed anywhere and will not have any implementation behind it. * @name jasmine.createSpy + * @since 1.3.0 * @function * @param {String} [name] - Name to give the spy. This will be displayed in failure messages. * @param {Function} [originalFn] - Function to act as the real implementation. @@ -6455,6 +6568,7 @@ getJasmineRequireObj().interface = function(jasmine, env) { /** * Create an object with multiple {@link Spy}s as its members. * @name jasmine.createSpyObj + * @since 1.3.0 * @function * @param {String} [baseName] - Base name for the spies in the object. * @param {String[]|Object} methodNames - Array of method names to create spies for, or Object whose keys will be method names and values the {@link Spy#and#returnValue|returnValue}. @@ -6469,6 +6583,7 @@ getJasmineRequireObj().interface = function(jasmine, env) { * * _Note:_ This is only callable from within a {@link beforeEach}, {@link it}, or {@link beforeAll}. * @name jasmine.addSpyStrategy + * @since 3.5.0 * @function * @param {String} name - The name of the strategy (i.e. what you call from `and`) * @param {Function} factory - Factory function that returns the plan to be executed. @@ -6589,6 +6704,7 @@ getJasmineRequireObj().Spy = function(j$) { * whenever the spy is called with arguments that don't match any strategy * created with {@link Spy#withArgs}. * @name Spy#and + * @since 2.0.0 * @example * spyOn(someObj, 'func').and.returnValue(42); */ @@ -6597,6 +6713,7 @@ getJasmineRequireObj().Spy = function(j$) { * Specifies a strategy to be used for calls to the spy that have the * specified arguments. * @name Spy#withArgs + * @since 3.0.0 * @function * @param {...*} args - The arguments to match * @type {SpyStrategy} @@ -6953,6 +7070,7 @@ getJasmineRequireObj().SpyStrategy = function(j$) { /** * Get the identifying information for the spy. * @name SpyStrategy#identity + * @since 3.0.0 * @member * @type {String} */ @@ -6990,6 +7108,7 @@ getJasmineRequireObj().SpyStrategy = function(j$) { /** * Tell the spy to return a promise resolving to the specified value when invoked. * @name SpyStrategy#resolveTo + * @since 3.5.0 * @function * @param {*} value The value to return. */ @@ -7004,6 +7123,7 @@ getJasmineRequireObj().SpyStrategy = function(j$) { /** * Tell the spy to return a promise rejecting with the specified value when invoked. * @name SpyStrategy#rejectWith + * @since 3.5.0 * @function * @param {*} value The value to return. */ @@ -7033,6 +7153,7 @@ getJasmineRequireObj().SpyStrategy = function(j$) { /** * Execute the current spy strategy. * @name SpyStrategy#exec + * @since 2.0.0 * @function */ SpyStrategy.prototype.exec = function(context, args) { @@ -7042,6 +7163,7 @@ getJasmineRequireObj().SpyStrategy = function(j$) { /** * Tell the spy to call through to the real implementation when invoked. * @name SpyStrategy#callThrough + * @since 2.0.0 * @function */ SpyStrategy.prototype.callThrough = function() { @@ -7052,6 +7174,7 @@ getJasmineRequireObj().SpyStrategy = function(j$) { /** * Tell the spy to return the value when invoked. * @name SpyStrategy#returnValue + * @since 2.0.0 * @function * @param {*} value The value to return. */ @@ -7065,6 +7188,7 @@ getJasmineRequireObj().SpyStrategy = function(j$) { /** * Tell the spy to return one of the specified values (sequentially) each time the spy is invoked. * @name SpyStrategy#returnValues + * @since 2.1.0 * @function * @param {...*} values - Values to be returned on subsequent calls to the spy. */ @@ -7079,6 +7203,7 @@ getJasmineRequireObj().SpyStrategy = function(j$) { /** * Tell the spy to throw an error when invoked. * @name SpyStrategy#throwError + * @since 2.0.0 * @function * @param {Error|String} something Thing to throw */ @@ -7093,6 +7218,7 @@ getJasmineRequireObj().SpyStrategy = function(j$) { /** * Tell the spy to call a fake implementation when invoked. * @name SpyStrategy#callFake + * @since 2.0.0 * @function * @param {Function} fn The function to invoke with the passed parameters. */ @@ -7109,6 +7235,7 @@ getJasmineRequireObj().SpyStrategy = function(j$) { /** * Tell the spy to do nothing when invoked. This is the default. * @name SpyStrategy#stub + * @since 2.0.0 * @function */ SpyStrategy.prototype.stub = function(fn) { diff --git a/src/core/CallTracker.js b/src/core/CallTracker.js index e856d2ad..8613a250 100644 --- a/src/core/CallTracker.js +++ b/src/core/CallTracker.js @@ -1,6 +1,7 @@ getJasmineRequireObj().CallTracker = function(j$) { /** * @namespace Spy#calls + * @since 2.0.0 */ function CallTracker() { var calls = []; @@ -16,6 +17,7 @@ getJasmineRequireObj().CallTracker = function(j$) { /** * Check whether this spy has been invoked. * @name Spy#calls#any + * @since 2.0.0 * @function * @return {Boolean} */ @@ -26,6 +28,7 @@ getJasmineRequireObj().CallTracker = function(j$) { /** * Get the number of invocations of this spy. * @name Spy#calls#count + * @since 2.0.0 * @function * @return {Integer} */ @@ -36,6 +39,7 @@ getJasmineRequireObj().CallTracker = function(j$) { /** * Get the arguments that were passed to a specific invocation of this spy. * @name Spy#calls#argsFor + * @since 2.0.0 * @function * @param {Integer} index The 0-based invocation index. * @return {Array} @@ -48,6 +52,7 @@ getJasmineRequireObj().CallTracker = function(j$) { /** * Get the raw calls array for this spy. * @name Spy#calls#all + * @since 2.0.0 * @function * @return {Spy.callData[]} */ @@ -58,6 +63,7 @@ getJasmineRequireObj().CallTracker = function(j$) { /** * Get all of the arguments for each invocation of this spy in the order they were received. * @name Spy#calls#allArgs + * @since 2.0.0 * @function * @return {Array} */ @@ -73,6 +79,7 @@ getJasmineRequireObj().CallTracker = function(j$) { /** * Get the first invocation of this spy. * @name Spy#calls#first + * @since 2.0.0 * @function * @return {ObjecSpy.callData} */ @@ -83,6 +90,7 @@ getJasmineRequireObj().CallTracker = function(j$) { /** * Get the most recent invocation of this spy. * @name Spy#calls#mostRecent + * @since 2.0.0 * @function * @return {ObjecSpy.callData} */ @@ -93,6 +101,7 @@ getJasmineRequireObj().CallTracker = function(j$) { /** * Reset this spy as if it has never been called. * @name Spy#calls#reset + * @since 2.0.0 * @function */ this.reset = function() { @@ -102,6 +111,7 @@ getJasmineRequireObj().CallTracker = function(j$) { /** * Set this spy to do a shallow clone of arguments passed to each invocation. * @name Spy#calls#saveArgumentsByValue + * @since 2.5.0 * @function */ this.saveArgumentsByValue = function() { diff --git a/src/core/Clock.js b/src/core/Clock.js index 370eca18..0ec89e23 100644 --- a/src/core/Clock.js +++ b/src/core/Clock.js @@ -33,6 +33,7 @@ getJasmineRequireObj().Clock = function() { /** * Install the mock clock over the built-in methods. * @name Clock#install + * @since 2.0.0 * @function * @return {Clock} */ @@ -53,6 +54,7 @@ getJasmineRequireObj().Clock = function() { /** * Uninstall the mock clock, returning the built-in methods to their places. * @name Clock#uninstall + * @since 2.0.0 * @function */ self.uninstall = function() { @@ -69,6 +71,7 @@ getJasmineRequireObj().Clock = function() { * * The clock will be {@link Clock#install|install}ed before the function is called and {@link Clock#uninstall|uninstall}ed in a `finally` after the function completes. * @name Clock#withMock + * @since 2.3.0 * @function * @param {Function} closure The function to be called. */ @@ -84,6 +87,7 @@ getJasmineRequireObj().Clock = function() { /** * Instruct the installed Clock to also mock the date returned by `new Date()` * @name Clock#mockDate + * @since 2.1.0 * @function * @param {Date} [initialDate=now] The `Date` to provide. */ @@ -116,6 +120,7 @@ getJasmineRequireObj().Clock = function() { /** * Tick the Clock forward, running any enqueued timeouts along the way * @name Clock#tick + * @since 1.3.0 * @function * @param {int} millis The number of milliseconds to tick. */ diff --git a/src/core/Env.js b/src/core/Env.js index 18924dcd..a031f3ff 100644 --- a/src/core/Env.js +++ b/src/core/Env.js @@ -2,6 +2,7 @@ getJasmineRequireObj().Env = function(j$) { /** * _Note:_ Do not construct this directly, Jasmine will make one during booting. * @name Env + * @since 2.0.0 * @classdesc The Jasmine environment * @constructor */ @@ -36,11 +37,13 @@ getJasmineRequireObj().Env = function(j$) { * This represents the available options to configure Jasmine. * Options that are not provided will use their default values * @interface Configuration + * @since 3.3.0 */ var config = { /** * Whether to randomize spec execution order * @name Configuration#random + * @since 3.3.0 * @type Boolean * @default true */ @@ -49,6 +52,7 @@ getJasmineRequireObj().Env = function(j$) { * Seed to use as the basis of randomization. * Null causes the seed to be determined randomly at the start of execution. * @name Configuration#seed + * @since 3.3.0 * @type function * @default null */ @@ -56,6 +60,7 @@ getJasmineRequireObj().Env = function(j$) { /** * Whether to stop execution of the suite after the first spec failure * @name Configuration#failFast + * @since 3.3.0 * @type Boolean * @default false */ @@ -63,6 +68,7 @@ getJasmineRequireObj().Env = function(j$) { /** * Whether to cause specs to only have one expectation failure. * @name Configuration#oneFailurePerSpec + * @since 3.3.0 * @type Boolean * @default false */ @@ -70,6 +76,7 @@ getJasmineRequireObj().Env = function(j$) { /** * Function to use to filter specs * @name Configuration#specFilter + * @since 3.3.0 * @type function * @default true */ @@ -80,6 +87,7 @@ getJasmineRequireObj().Env = function(j$) { * Whether or not reporters should hide disabled specs from their output. * Currently only supported by Jasmine's HTMLReporter * @name Configuration#hideDisabled + * @since 3.3.0 * @type Boolean * @default false */ @@ -89,6 +97,7 @@ getJasmineRequireObj().Env = function(j$) { * to create a promise. If not set, it will default to whatever global Promise * library is available (if any). * @name Configuration#Promise + * @since 3.5.0 * @type function * @default undefined */ @@ -137,6 +146,7 @@ getJasmineRequireObj().Env = function(j$) { /** * Configure your jasmine environment * @name Env#configure + * @since 3.3.0 * @argument {Configuration} configuration * @function */ @@ -182,6 +192,7 @@ getJasmineRequireObj().Env = function(j$) { /** * Get the current configuration for your jasmine environment * @name Env#configuration + * @since 3.3.0 * @function * @returns {Configuration} */ @@ -349,6 +360,7 @@ getJasmineRequireObj().Env = function(j$) { * Sets whether Jasmine should throw an Error when an expectation fails. * This causes a spec to only have one expectation failure. * @name Env#throwOnExpectationFailure + * @since 2.3.0 * @function * @param {Boolean} value Whether to throw when a expectation fails * @deprecated Use the `oneFailurePerSpec` option with {@link Env#configure} @@ -370,6 +382,7 @@ getJasmineRequireObj().Env = function(j$) { /** * Set whether to stop suite execution when a spec fails * @name Env#stopOnSpecFailure + * @since 2.7.0 * @function * @param {Boolean} value Whether to stop suite execution when a spec fails * @deprecated Use the `failFast` option with {@link Env#configure} @@ -391,6 +404,7 @@ getJasmineRequireObj().Env = function(j$) { /** * Set whether to randomize test execution order * @name Env#randomizeTests + * @since 2.4.0 * @function * @param {Boolean} value Whether to randomize execution order * @deprecated Use the `random` option with {@link Env#configure} @@ -412,6 +426,7 @@ getJasmineRequireObj().Env = function(j$) { /** * Set the random number seed for spec randomization * @name Env#seed + * @since 2.4.0 * @function * @param {Number} value The seed value * @deprecated Use the `seed` option with {@link Env#configure} @@ -435,6 +450,7 @@ getJasmineRequireObj().Env = function(j$) { /** * @name Env#hideDisabled + * @since 3.2.0 * @function */ this.hideDisabled = function(value) { @@ -682,6 +698,7 @@ getJasmineRequireObj().Env = function(j$) { /** * Add a custom reporter to the Jasmine environment. * @name Env#addReporter + * @since 2.0.0 * @function * @param {Reporter} reporterToAdd The reporter to be added. * @see custom_reporter @@ -693,6 +710,7 @@ getJasmineRequireObj().Env = function(j$) { /** * Provide a fallback reporter if no other reporters have been specified. * @name Env#provideFallbackReporter + * @since 2.5.0 * @function * @param {Reporter} reporterToAdd The reporter * @see custom_reporter @@ -704,6 +722,7 @@ getJasmineRequireObj().Env = function(j$) { /** * Clear all registered reporters * @name Env#clearReporters + * @since 2.5.2 * @function */ this.clearReporters = function() { diff --git a/src/core/Expectation.js b/src/core/Expectation.js index e1833433..4bfbb327 100644 --- a/src/core/Expectation.js +++ b/src/core/Expectation.js @@ -25,6 +25,7 @@ getJasmineRequireObj().Expectation = function(j$) { * Add some context for an {@link expect} * @function * @name matchers#withContext + * @since 3.3.0 * @param {String} message - Additional context to show when the matcher fails * @return {matchers} */ @@ -36,6 +37,7 @@ getJasmineRequireObj().Expectation = function(j$) { * Invert the matcher following this {@link expect} * @member * @name matchers#not + * @since 1.3.0 * @type {matchers} * @example * expect(something).not.toBe(true); @@ -69,6 +71,7 @@ getJasmineRequireObj().Expectation = function(j$) { * Add some context for an {@link expectAsync} * @function * @name async-matchers#withContext + * @since 3.3.0 * @param {String} message - Additional context to show when the async matcher fails * @return {async-matchers} */ diff --git a/src/core/JsApiReporter.js b/src/core/JsApiReporter.js index 514b3a6c..8875a45e 100644 --- a/src/core/JsApiReporter.js +++ b/src/core/JsApiReporter.js @@ -31,6 +31,7 @@ getJasmineRequireObj().JsApiReporter = function(j$) { /** * Get the current status for the Jasmine environment. * @name jsApiReporter#status + * @since 2.0.0 * @function * @return {String} - One of `loaded`, `started`, or `done` */ @@ -54,6 +55,7 @@ getJasmineRequireObj().JsApiReporter = function(j$) { * * Retrievable in slices for easier serialization. * @name jsApiReporter#suiteResults + * @since 2.1.0 * @function * @param {Number} index - The position in the suites list to start from. * @param {Number} length - Maximum number of suite results to return. @@ -71,6 +73,7 @@ getJasmineRequireObj().JsApiReporter = function(j$) { /** * Get all of the suites in a single object, with their `id` as the key. * @name jsApiReporter#suites + * @since 2.0.0 * @function * @return {Object} - Map of suite id to {@link SuiteResult} */ @@ -89,6 +92,7 @@ getJasmineRequireObj().JsApiReporter = function(j$) { * * Retrievable in slices for easier serialization. * @name jsApiReporter#specResults + * @since 2.0.0 * @function * @param {Number} index - The position in the specs list to start from. * @param {Number} length - Maximum number of specs results to return. @@ -101,6 +105,7 @@ getJasmineRequireObj().JsApiReporter = function(j$) { /** * Get all spec results. * @name jsApiReporter#specs + * @since 2.0.0 * @function * @return {SpecResult[]} */ @@ -111,6 +116,7 @@ getJasmineRequireObj().JsApiReporter = function(j$) { /** * Get the number of milliseconds it took for the full Jasmine suite to run. * @name jsApiReporter#executionTime + * @since 2.0.0 * @function * @return {Number} */ diff --git a/src/core/Spy.js b/src/core/Spy.js index 753499bb..c3a0f3fb 100644 --- a/src/core/Spy.js +++ b/src/core/Spy.js @@ -107,6 +107,7 @@ getJasmineRequireObj().Spy = function(j$) { * whenever the spy is called with arguments that don't match any strategy * created with {@link Spy#withArgs}. * @name Spy#and + * @since 2.0.0 * @example * spyOn(someObj, 'func').and.returnValue(42); */ @@ -115,6 +116,7 @@ getJasmineRequireObj().Spy = function(j$) { * Specifies a strategy to be used for calls to the spy that have the * specified arguments. * @name Spy#withArgs + * @since 3.0.0 * @function * @param {...*} args - The arguments to match * @type {SpyStrategy} diff --git a/src/core/SpyStrategy.js b/src/core/SpyStrategy.js index e1559a7d..83985967 100644 --- a/src/core/SpyStrategy.js +++ b/src/core/SpyStrategy.js @@ -10,6 +10,7 @@ getJasmineRequireObj().SpyStrategy = function(j$) { /** * Get the identifying information for the spy. * @name SpyStrategy#identity + * @since 3.0.0 * @member * @type {String} */ @@ -47,6 +48,7 @@ getJasmineRequireObj().SpyStrategy = function(j$) { /** * Tell the spy to return a promise resolving to the specified value when invoked. * @name SpyStrategy#resolveTo + * @since 3.5.0 * @function * @param {*} value The value to return. */ @@ -61,6 +63,7 @@ getJasmineRequireObj().SpyStrategy = function(j$) { /** * Tell the spy to return a promise rejecting with the specified value when invoked. * @name SpyStrategy#rejectWith + * @since 3.5.0 * @function * @param {*} value The value to return. */ @@ -90,6 +93,7 @@ getJasmineRequireObj().SpyStrategy = function(j$) { /** * Execute the current spy strategy. * @name SpyStrategy#exec + * @since 2.0.0 * @function */ SpyStrategy.prototype.exec = function(context, args) { @@ -99,6 +103,7 @@ getJasmineRequireObj().SpyStrategy = function(j$) { /** * Tell the spy to call through to the real implementation when invoked. * @name SpyStrategy#callThrough + * @since 2.0.0 * @function */ SpyStrategy.prototype.callThrough = function() { @@ -109,6 +114,7 @@ getJasmineRequireObj().SpyStrategy = function(j$) { /** * Tell the spy to return the value when invoked. * @name SpyStrategy#returnValue + * @since 2.0.0 * @function * @param {*} value The value to return. */ @@ -122,6 +128,7 @@ getJasmineRequireObj().SpyStrategy = function(j$) { /** * Tell the spy to return one of the specified values (sequentially) each time the spy is invoked. * @name SpyStrategy#returnValues + * @since 2.1.0 * @function * @param {...*} values - Values to be returned on subsequent calls to the spy. */ @@ -136,6 +143,7 @@ getJasmineRequireObj().SpyStrategy = function(j$) { /** * Tell the spy to throw an error when invoked. * @name SpyStrategy#throwError + * @since 2.0.0 * @function * @param {Error|String} something Thing to throw */ @@ -150,6 +158,7 @@ getJasmineRequireObj().SpyStrategy = function(j$) { /** * Tell the spy to call a fake implementation when invoked. * @name SpyStrategy#callFake + * @since 2.0.0 * @function * @param {Function} fn The function to invoke with the passed parameters. */ @@ -166,6 +175,7 @@ getJasmineRequireObj().SpyStrategy = function(j$) { /** * Tell the spy to do nothing when invoked. This is the default. * @name SpyStrategy#stub + * @since 2.0.0 * @function */ SpyStrategy.prototype.stub = function(fn) { diff --git a/src/core/base.js b/src/core/base.js index 40faa4ce..deed4ef2 100644 --- a/src/core/base.js +++ b/src/core/base.js @@ -7,6 +7,7 @@ getJasmineRequireObj().base = function(j$, jasmineGlobal) { * Maximum object depth the pretty printer will print to. * Set this to a lower value to speed up pretty printing if you have large objects. * @name jasmine.MAX_PRETTY_PRINT_DEPTH + * @since 1.3.0 */ j$.MAX_PRETTY_PRINT_DEPTH = 8; /** @@ -14,17 +15,20 @@ getJasmineRequireObj().base = function(j$, jasmineGlobal) { * This will also limit the number of keys and values displayed for an object. * Elements past this number will be ellipised. * @name jasmine.MAX_PRETTY_PRINT_ARRAY_LENGTH + * @since 2.7.0 */ j$.MAX_PRETTY_PRINT_ARRAY_LENGTH = 50; /** * Maximum number of characters to display when pretty printing objects. * Characters past this number will be ellipised. * @name jasmine.MAX_PRETTY_PRINT_CHARS + * @since 2.9.0 */ j$.MAX_PRETTY_PRINT_CHARS = 1000; /** * Default number of milliseconds Jasmine will wait for an asynchronous spec to complete. * @name jasmine.DEFAULT_TIMEOUT_INTERVAL + * @since 1.3.0 */ j$.DEFAULT_TIMEOUT_INTERVAL = 5000; @@ -36,6 +40,7 @@ getJasmineRequireObj().base = function(j$, jasmineGlobal) { * Get the currently booted Jasmine Environment. * * @name jasmine.getEnv + * @since 1.3.0 * @function * @return {Env} */ @@ -163,6 +168,7 @@ getJasmineRequireObj().base = function(j$, jasmineGlobal) { * Get a matcher, usable in any {@link matchers|matcher} that uses Jasmine's equality (e.g. {@link matchers#toEqual|toEqual}, {@link matchers#toContain|toContain}, or {@link matchers#toHaveBeenCalledWith|toHaveBeenCalledWith}), * that will succeed if the actual value being compared is an instance of the specified class/constructor. * @name jasmine.any + * @since 1.3.0 * @function * @param {Constructor} clazz - The constructor to check against. */ @@ -174,6 +180,7 @@ getJasmineRequireObj().base = function(j$, jasmineGlobal) { * Get a matcher, usable in any {@link matchers|matcher} that uses Jasmine's equality (e.g. {@link matchers#toEqual|toEqual}, {@link matchers#toContain|toContain}, or {@link matchers#toHaveBeenCalledWith|toHaveBeenCalledWith}), * that will succeed if the actual value being compared is not `null` and not `undefined`. * @name jasmine.anything + * @since 2.2.0 * @function */ j$.anything = function() { @@ -184,6 +191,7 @@ getJasmineRequireObj().base = function(j$, jasmineGlobal) { * Get a matcher, usable in any {@link matchers|matcher} that uses Jasmine's equality (e.g. {@link matchers#toEqual|toEqual}, {@link matchers#toContain|toContain}, or {@link matchers#toHaveBeenCalledWith|toHaveBeenCalledWith}), * that will succeed if the actual value being compared is `true` or anything truthy. * @name jasmine.truthy + * @since 3.1.0 * @function */ j$.truthy = function() { @@ -194,6 +202,7 @@ getJasmineRequireObj().base = function(j$, jasmineGlobal) { * Get a matcher, usable in any {@link matchers|matcher} that uses Jasmine's equality (e.g. {@link matchers#toEqual|toEqual}, {@link matchers#toContain|toContain}, or {@link matchers#toHaveBeenCalledWith|toHaveBeenCalledWith}), * that will succeed if the actual value being compared is `null`, `undefined`, `0`, `false` or anything falsey. * @name jasmine.falsy + * @since 3.1.0 * @function */ j$.falsy = function() { @@ -204,6 +213,7 @@ getJasmineRequireObj().base = function(j$, jasmineGlobal) { * Get a matcher, usable in any {@link matchers|matcher} that uses Jasmine's equality (e.g. {@link matchers#toEqual|toEqual}, {@link matchers#toContain|toContain}, or {@link matchers#toHaveBeenCalledWith|toHaveBeenCalledWith}), * that will succeed if the actual value being compared is empty. * @name jasmine.empty + * @since 3.1.0 * @function */ j$.empty = function() { @@ -214,6 +224,7 @@ getJasmineRequireObj().base = function(j$, jasmineGlobal) { * Get a matcher, usable in any {@link matchers|matcher} that uses Jasmine's equality (e.g. {@link matchers#toEqual|toEqual}, {@link matchers#toContain|toContain}, or {@link matchers#toHaveBeenCalledWith|toHaveBeenCalledWith}), * that will succeed if the actual value being compared is not empty. * @name jasmine.notEmpty + * @since 3.1.0 * @function */ j$.notEmpty = function() { @@ -224,6 +235,7 @@ getJasmineRequireObj().base = function(j$, jasmineGlobal) { * Get a matcher, usable in any {@link matchers|matcher} that uses Jasmine's equality (e.g. {@link matchers#toEqual|toEqual}, {@link matchers#toContain|toContain}, or {@link matchers#toHaveBeenCalledWith|toHaveBeenCalledWith}), * that will succeed if the actual value being compared contains at least the keys and values. * @name jasmine.objectContaining + * @since 1.3.0 * @function * @param {Object} sample - The subset of properties that _must_ be in the actual. */ @@ -235,6 +247,7 @@ getJasmineRequireObj().base = function(j$, jasmineGlobal) { * Get a matcher, usable in any {@link matchers|matcher} that uses Jasmine's equality (e.g. {@link matchers#toEqual|toEqual}, {@link matchers#toContain|toContain}, or {@link matchers#toHaveBeenCalledWith|toHaveBeenCalledWith}), * that will succeed if the actual value is a `String` that matches the `RegExp` or `String`. * @name jasmine.stringMatching + * @since 2.2.0 * @function * @param {RegExp|String} expected */ @@ -246,6 +259,7 @@ getJasmineRequireObj().base = function(j$, jasmineGlobal) { * Get a matcher, usable in any {@link matchers|matcher} that uses Jasmine's equality (e.g. {@link matchers#toEqual|toEqual}, {@link matchers#toContain|toContain}, or {@link matchers#toHaveBeenCalledWith|toHaveBeenCalledWith}), * that will succeed if the actual value is an `Array` that contains at least the elements in the sample. * @name jasmine.arrayContaining + * @since 2.2.0 * @function * @param {Array} sample */ @@ -257,6 +271,7 @@ getJasmineRequireObj().base = function(j$, jasmineGlobal) { * Get a matcher, usable in any {@link matchers|matcher} that uses Jasmine's equality (e.g. {@link matchers#toEqual|toEqual}, {@link matchers#toContain|toContain}, or {@link matchers#toHaveBeenCalledWith|toHaveBeenCalledWith}), * that will succeed if the actual value is an `Array` that contains all of the elements in the sample in any order. * @name jasmine.arrayWithExactContents + * @since 2.8.0 * @function * @param {Array} sample */ diff --git a/src/core/matchers/async/toBeRejected.js b/src/core/matchers/async/toBeRejected.js index 8451e8df..c3b53aa4 100644 --- a/src/core/matchers/async/toBeRejected.js +++ b/src/core/matchers/async/toBeRejected.js @@ -4,6 +4,7 @@ getJasmineRequireObj().toBeRejected = function(j$) { * @function * @async * @name async-matchers#toBeRejected + * @since 3.1.0 * @example * await expectAsync(aPromise).toBeRejected(); * @example diff --git a/src/core/matchers/async/toBeRejectedWith.js b/src/core/matchers/async/toBeRejectedWith.js index 3e302de2..62748412 100644 --- a/src/core/matchers/async/toBeRejectedWith.js +++ b/src/core/matchers/async/toBeRejectedWith.js @@ -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'}); diff --git a/src/core/matchers/async/toBeRejectedWithError.js b/src/core/matchers/async/toBeRejectedWithError.js index 88f1c11f..84144c31 100644 --- a/src/core/matchers/async/toBeRejectedWithError.js +++ b/src/core/matchers/async/toBeRejectedWithError.js @@ -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 diff --git a/src/core/matchers/async/toBeResolved.js b/src/core/matchers/async/toBeResolved.js index a26f265d..e998a116 100644 --- a/src/core/matchers/async/toBeResolved.js +++ b/src/core/matchers/async/toBeResolved.js @@ -4,6 +4,7 @@ getJasmineRequireObj().toBeResolved = function(j$) { * @function * @async * @name async-matchers#toBeResolved + * @since 3.1.0 * @example * await expectAsync(aPromise).toBeResolved(); * @example diff --git a/src/core/matchers/async/toBeResolvedTo.js b/src/core/matchers/async/toBeResolvedTo.js index f178b673..ff2b943c 100644 --- a/src/core/matchers/async/toBeResolvedTo.js +++ b/src/core/matchers/async/toBeResolvedTo.js @@ -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'}); diff --git a/src/core/matchers/nothing.js b/src/core/matchers/nothing.js index 625236b3..687cec28 100644 --- a/src/core/matchers/nothing.js +++ b/src/core/matchers/nothing.js @@ -3,6 +3,7 @@ getJasmineRequireObj().nothing = function() { * {@link expect} nothing explicitly. * @function * @name matchers#nothing + * @since 2.8.0 * @example * expect().nothing(); */ diff --git a/src/core/matchers/toBe.js b/src/core/matchers/toBe.js index f92ed1ba..3aab9416 100644 --- a/src/core/matchers/toBe.js +++ b/src/core/matchers/toBe.js @@ -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); diff --git a/src/core/matchers/toBeCloseTo.js b/src/core/matchers/toBeCloseTo.js index b57ca1ad..6cd0a018 100644 --- a/src/core/matchers/toBeCloseTo.js +++ b/src/core/matchers/toBeCloseTo.js @@ -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 diff --git a/src/core/matchers/toBeDefined.js b/src/core/matchers/toBeDefined.js index c9b7203b..ae95091a 100644 --- a/src/core/matchers/toBeDefined.js +++ b/src/core/matchers/toBeDefined.js @@ -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(); */ diff --git a/src/core/matchers/toBeFalse.js b/src/core/matchers/toBeFalse.js index 619e5c36..e26fb834 100644 --- a/src/core/matchers/toBeFalse.js +++ b/src/core/matchers/toBeFalse.js @@ -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(); */ diff --git a/src/core/matchers/toBeFalsy.js b/src/core/matchers/toBeFalsy.js index 9ef75792..db61d465 100644 --- a/src/core/matchers/toBeFalsy.js +++ b/src/core/matchers/toBeFalsy.js @@ -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(); */ diff --git a/src/core/matchers/toBeGreaterThan.js b/src/core/matchers/toBeGreaterThan.js index 8bda38a4..ffe7ad61 100644 --- a/src/core/matchers/toBeGreaterThan.js +++ b/src/core/matchers/toBeGreaterThan.js @@ -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); diff --git a/src/core/matchers/toBeGreaterThanOrEqual.js b/src/core/matchers/toBeGreaterThanOrEqual.js index f3327ce1..1f33b5e6 100644 --- a/src/core/matchers/toBeGreaterThanOrEqual.js +++ b/src/core/matchers/toBeGreaterThanOrEqual.js @@ -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); diff --git a/src/core/matchers/toBeInstanceOf.js b/src/core/matchers/toBeInstanceOf.js index 55d419b3..66b658c1 100644 --- a/src/core/matchers/toBeInstanceOf.js +++ b/src/core/matchers/toBeInstanceOf.js @@ -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); diff --git a/src/core/matchers/toBeLessThan.js b/src/core/matchers/toBeLessThan.js index 58681cae..319113a0 100644 --- a/src/core/matchers/toBeLessThan.js +++ b/src/core/matchers/toBeLessThan.js @@ -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); diff --git a/src/core/matchers/toBeLessThanOrEqual.js b/src/core/matchers/toBeLessThanOrEqual.js index a0c91790..4820fc97 100644 --- a/src/core/matchers/toBeLessThanOrEqual.js +++ b/src/core/matchers/toBeLessThanOrEqual.js @@ -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); diff --git a/src/core/matchers/toBeNaN.js b/src/core/matchers/toBeNaN.js index 15cff52a..dcff00a1 100644 --- a/src/core/matchers/toBeNaN.js +++ b/src/core/matchers/toBeNaN.js @@ -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(); */ diff --git a/src/core/matchers/toBeNegativeInfinity.js b/src/core/matchers/toBeNegativeInfinity.js index d7d24d59..ce60a62d 100644 --- a/src/core/matchers/toBeNegativeInfinity.js +++ b/src/core/matchers/toBeNegativeInfinity.js @@ -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(); */ diff --git a/src/core/matchers/toBeNull.js b/src/core/matchers/toBeNull.js index d347d445..36b06133 100644 --- a/src/core/matchers/toBeNull.js +++ b/src/core/matchers/toBeNull.js @@ -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(); */ diff --git a/src/core/matchers/toBePositiveInfinity.js b/src/core/matchers/toBePositiveInfinity.js index 60acded4..c1c41f8e 100644 --- a/src/core/matchers/toBePositiveInfinity.js +++ b/src/core/matchers/toBePositiveInfinity.js @@ -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(); */ diff --git a/src/core/matchers/toBeTrue.js b/src/core/matchers/toBeTrue.js index 4834bf4e..63331093 100644 --- a/src/core/matchers/toBeTrue.js +++ b/src/core/matchers/toBeTrue.js @@ -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(); */ diff --git a/src/core/matchers/toBeTruthy.js b/src/core/matchers/toBeTruthy.js index 7806bcda..3bece851 100644 --- a/src/core/matchers/toBeTruthy.js +++ b/src/core/matchers/toBeTruthy.js @@ -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(); */ diff --git a/src/core/matchers/toBeUndefined.js b/src/core/matchers/toBeUndefined.js index 455b8f76..04469364 100644 --- a/src/core/matchers/toBeUndefined.js +++ b/src/core/matchers/toBeUndefined.js @@ -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(): */ diff --git a/src/core/matchers/toContain.js b/src/core/matchers/toContain.js index 141c3ded..440bb4c4 100644 --- a/src/core/matchers/toContain.js +++ b/src/core/matchers/toContain.js @@ -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); diff --git a/src/core/matchers/toEqual.js b/src/core/matchers/toEqual.js index 33be478e..8697ed67 100644 --- a/src/core/matchers/toEqual.js +++ b/src/core/matchers/toEqual.js @@ -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']}); diff --git a/src/core/matchers/toHaveBeenCalled.js b/src/core/matchers/toHaveBeenCalled.js index b6836f45..bf1df2ed 100644 --- a/src/core/matchers/toHaveBeenCalled.js +++ b/src/core/matchers/toHaveBeenCalled.js @@ -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(); diff --git a/src/core/matchers/toHaveBeenCalledBefore.js b/src/core/matchers/toHaveBeenCalledBefore.js index eb98c07d..5c9b7063 100644 --- a/src/core/matchers/toHaveBeenCalledBefore.js +++ b/src/core/matchers/toHaveBeenCalledBefore.js @@ -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); diff --git a/src/core/matchers/toHaveBeenCalledTimes.js b/src/core/matchers/toHaveBeenCalledTimes.js index b05ee8fe..282f8776 100644 --- a/src/core/matchers/toHaveBeenCalledTimes.js +++ b/src/core/matchers/toHaveBeenCalledTimes.js @@ -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); diff --git a/src/core/matchers/toHaveBeenCalledWith.js b/src/core/matchers/toHaveBeenCalledWith.js index 0cafcc69..05ddd4e2 100644 --- a/src/core/matchers/toHaveBeenCalledWith.js +++ b/src/core/matchers/toHaveBeenCalledWith.js @@ -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); diff --git a/src/core/matchers/toHaveClass.js b/src/core/matchers/toHaveClass.js index 99f784f3..a2fd7507 100644 --- a/src/core/matchers/toHaveClass.js +++ b/src/core/matchers/toHaveClass.js @@ -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'); diff --git a/src/core/matchers/toMatch.js b/src/core/matchers/toMatch.js index 380dfc26..7d8f658c 100644 --- a/src/core/matchers/toMatch.js +++ b/src/core/matchers/toMatch.js @@ -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$/); diff --git a/src/core/matchers/toThrow.js b/src/core/matchers/toThrow.js index 5337c7f7..a7e089d6 100644 --- a/src/core/matchers/toThrow.js +++ b/src/core/matchers/toThrow.js @@ -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'); diff --git a/src/core/matchers/toThrowError.js b/src/core/matchers/toThrowError.js index ca3bfc5e..11c6d746 100644 --- a/src/core/matchers/toThrowError.js +++ b/src/core/matchers/toThrowError.js @@ -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 diff --git a/src/core/matchers/toThrowMatching.js b/src/core/matchers/toThrowMatching.js index bcc37166..bf9be39e 100644 --- a/src/core/matchers/toThrowMatching.js +++ b/src/core/matchers/toThrowMatching.js @@ -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'; }); diff --git a/src/core/requireInterface.js b/src/core/requireInterface.js index cff7403b..2abe12d2 100644 --- a/src/core/requireInterface.js +++ b/src/core/requireInterface.js @@ -15,6 +15,7 @@ getJasmineRequireObj().interface = function(jasmine, env) { * * Calls to `describe` can be nested within other calls to compose your suite as a tree. * @name describe + * @since 1.3.0 * @function * @global * @param {String} description Textual description of the group @@ -29,6 +30,7 @@ getJasmineRequireObj().interface = function(jasmine, env) { * * Specs within an `xdescribe` will be marked pending and not executed * @name xdescribe + * @since 1.3.0 * @function * @global * @param {String} description Textual description of the group @@ -44,6 +46,7 @@ getJasmineRequireObj().interface = function(jasmine, env) { * If suites or specs are focused, only those that are focused will be executed * @see fit * @name fdescribe + * @since 2.1.0 * @function * @global * @param {String} description Textual description of the group @@ -58,6 +61,7 @@ getJasmineRequireObj().interface = function(jasmine, env) { * * A spec whose expectations all succeed will be passing and a spec with any failures will fail. * @name it + * @since 1.3.0 * @function * @global * @param {String} description Textual description of what this spec is checking @@ -74,6 +78,7 @@ getJasmineRequireObj().interface = function(jasmine, env) { * * The spec will report as `pending` and will not be executed. * @name xit + * @since 1.3.0 * @function * @global * @param {String} description Textual description of what this spec is checking. @@ -88,6 +93,7 @@ getJasmineRequireObj().interface = function(jasmine, env) { * * If suites or specs are focused, only those that are focused will be executed. * @name fit + * @since 2.1.0 * @function * @global * @param {String} description Textual description of what this spec is checking. @@ -102,6 +108,7 @@ getJasmineRequireObj().interface = function(jasmine, env) { /** * Run some shared setup before each of the specs in the {@link describe} in which it is called. * @name beforeEach + * @since 1.3.0 * @function * @global * @param {implementationCallback} [function] Function that contains the code to setup your specs. @@ -115,6 +122,7 @@ getJasmineRequireObj().interface = function(jasmine, env) { /** * Run some shared teardown after each of the specs in the {@link describe} in which it is called. * @name afterEach + * @since 1.3.0 * @function * @global * @param {implementationCallback} [function] Function that contains the code to teardown your specs. @@ -130,6 +138,7 @@ getJasmineRequireObj().interface = function(jasmine, env) { * * _Note:_ Be careful, sharing the setup from a beforeAll makes it easy to accidentally leak state between your specs so that they erroneously pass or fail. * @name beforeAll + * @since 2.1.0 * @function * @global * @param {implementationCallback} [function] Function that contains the code to setup your specs. @@ -145,6 +154,7 @@ getJasmineRequireObj().interface = function(jasmine, env) { * * _Note:_ Be careful, sharing the teardown from a afterAll makes it easy to accidentally leak state between your specs so that they erroneously pass or fail. * @name afterAll + * @since 2.1.0 * @function * @global * @param {implementationCallback} [function] Function that contains the code to teardown your specs. @@ -158,6 +168,7 @@ getJasmineRequireObj().interface = function(jasmine, env) { /** * Create an expectation for a spec. * @name expect + * @since 1.3.0 * @function * @global * @param {Object} actual - Actual computed value to test expectations against. @@ -173,6 +184,7 @@ getJasmineRequireObj().interface = function(jasmine, env) { * which must be either returned from the spec or waited for using `await` * in order for Jasmine to associate them with the correct spec. * @name expectAsync + * @since 3.3.0 * @function * @global * @param {Object} actual - Actual computed value to test expectations against. @@ -189,6 +201,7 @@ getJasmineRequireObj().interface = function(jasmine, env) { /** * Mark a spec as pending, expectation results will be ignored. * @name pending + * @since 2.0.0 * @function * @global * @param {String} [message] - Reason the spec is pending. @@ -200,6 +213,7 @@ getJasmineRequireObj().interface = function(jasmine, env) { /** * Explicitly mark a spec as failed. * @name fail + * @since 2.1.0 * @function * @global * @param {String|Error} [error] - Reason for the failure. @@ -211,6 +225,7 @@ getJasmineRequireObj().interface = function(jasmine, env) { /** * Install a spy onto an existing object. * @name spyOn + * @since 1.3.0 * @function * @global * @param {Object} obj - The object upon which to install the {@link Spy}. @@ -224,6 +239,7 @@ getJasmineRequireObj().interface = function(jasmine, env) { /** * Install a spy on a property installed with `Object.defineProperty` onto an existing object. * @name spyOnProperty + * @since 2.6.0 * @function * @global * @param {Object} obj - The object upon which to install the {@link Spy} @@ -238,6 +254,7 @@ getJasmineRequireObj().interface = function(jasmine, env) { /** * Installs spies on all writable and configurable properties of an object. * @name spyOnAllFunctions + * @since 3.2.1 * @function * @global * @param {Object} obj - The object upon which to install the {@link Spy}s @@ -262,6 +279,7 @@ getJasmineRequireObj().interface = function(jasmine, env) { * * _Note:_ This is only callable from within a {@link beforeEach}, {@link it}, or {@link beforeAll}. * @name jasmine.addCustomEqualityTester + * @since 2.0.0 * @function * @param {Function} tester - A function which takes two arguments to compare and returns a `true` or `false` comparison result if it knows how to compare them, and `undefined` otherwise. * @see custom_equality @@ -275,6 +293,7 @@ getJasmineRequireObj().interface = function(jasmine, env) { * * _Note:_ This is only callable from within a {@link beforeEach}, {@link it}, or {@link beforeAll}. * @name jasmine.addMatchers + * @since 2.0.0 * @function * @param {Object} matchers - Keys from this object will be the new matcher names. * @see custom_matcher @@ -286,6 +305,7 @@ getJasmineRequireObj().interface = function(jasmine, env) { /** * Get the currently booted mock {Clock} for this Jasmine environment. * @name jasmine.clock + * @since 2.0.0 * @function * @returns {Clock} */ @@ -296,6 +316,7 @@ getJasmineRequireObj().interface = function(jasmine, env) { /** * Create a bare {@link Spy} object. This won't be installed anywhere and will not have any implementation behind it. * @name jasmine.createSpy + * @since 1.3.0 * @function * @param {String} [name] - Name to give the spy. This will be displayed in failure messages. * @param {Function} [originalFn] - Function to act as the real implementation. @@ -308,6 +329,7 @@ getJasmineRequireObj().interface = function(jasmine, env) { /** * Create an object with multiple {@link Spy}s as its members. * @name jasmine.createSpyObj + * @since 1.3.0 * @function * @param {String} [baseName] - Base name for the spies in the object. * @param {String[]|Object} methodNames - Array of method names to create spies for, or Object whose keys will be method names and values the {@link Spy#and#returnValue|returnValue}. @@ -322,6 +344,7 @@ getJasmineRequireObj().interface = function(jasmine, env) { * * _Note:_ This is only callable from within a {@link beforeEach}, {@link it}, or {@link beforeAll}. * @name jasmine.addSpyStrategy + * @since 3.5.0 * @function * @param {String} name - The name of the strategy (i.e. what you call from `and`) * @param {Function} factory - Factory function that returns the plan to be executed.