Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| bff612a169 | |||
| 4ba42f3746 | |||
| 58bee05c36 | |||
| c1871b0f0c | |||
| c16974b091 | |||
| bfedda9764 |
@@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
Jasmine is a Behavior Driven Development testing framework for JavaScript. It does not rely on browsers, DOM, or any JavaScript framework. Thus it's suited for websites, [Node.js](http://nodejs.org) projects, or anywhere that JavaScript can run.
|
Jasmine is a Behavior Driven Development testing framework for JavaScript. It does not rely on browsers, DOM, or any JavaScript framework. Thus it's suited for websites, [Node.js](http://nodejs.org) projects, or anywhere that JavaScript can run.
|
||||||
|
|
||||||
Upgrading from Jasmine 3.x? Check out the [upgrade guide](https://jasmine.github.io/tutorials/upgrading_to_Jasmine_4.0).
|
Upgrading from Jasmine 4.x? Check out the [upgrade guide](https://jasmine.github.io/tutorials/upgrading_to_Jasmine_5.0).
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
|
|||||||
@@ -2700,11 +2700,7 @@ getJasmineRequireObj().buildExpectationResult = function(j$) {
|
|||||||
} else if (options.stack) {
|
} else if (options.stack) {
|
||||||
error = options;
|
error = options;
|
||||||
} else {
|
} else {
|
||||||
try {
|
error = new Error(message());
|
||||||
throw new Error(message());
|
|
||||||
} catch (e) {
|
|
||||||
error = e;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Omit the message from the stack trace because it will be
|
// Omit the message from the stack trace because it will be
|
||||||
@@ -3228,6 +3224,9 @@ getJasmineRequireObj().CompleteOnFirstErrorSkipPolicy = function(j$) {
|
|||||||
return CompleteOnFirstErrorSkipPolicy;
|
return CompleteOnFirstErrorSkipPolicy;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Warning: don't add "use strict" to this file. Doing so potentially changes
|
||||||
|
// the behavior of user code that does things like setTimeout("var x = 1;")
|
||||||
|
// while the mock clock is installed.
|
||||||
getJasmineRequireObj().DelayedFunctionScheduler = function(j$) {
|
getJasmineRequireObj().DelayedFunctionScheduler = function(j$) {
|
||||||
function DelayedFunctionScheduler() {
|
function DelayedFunctionScheduler() {
|
||||||
this.scheduledLookup_ = [];
|
this.scheduledLookup_ = [];
|
||||||
@@ -3253,6 +3252,9 @@ getJasmineRequireObj().DelayedFunctionScheduler = function(j$) {
|
|||||||
) {
|
) {
|
||||||
let f;
|
let f;
|
||||||
if (typeof funcToCall === 'string') {
|
if (typeof funcToCall === 'string') {
|
||||||
|
// setTimeout("some code") and setInterval("some code") are legal, if
|
||||||
|
// not recommended. We don't do that ourselves, but user code might.
|
||||||
|
// This allows such code to work when the mock clock is installed.
|
||||||
f = function() {
|
f = function() {
|
||||||
// eslint-disable-next-line no-eval
|
// eslint-disable-next-line no-eval
|
||||||
return eval(funcToCall);
|
return eval(funcToCall);
|
||||||
@@ -7159,6 +7161,8 @@ getJasmineRequireObj().NeverSkipPolicy = function(j$) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
getJasmineRequireObj().ParallelReportDispatcher = function(j$) {
|
getJasmineRequireObj().ParallelReportDispatcher = function(j$) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @class ParallelReportDispatcher
|
* @class ParallelReportDispatcher
|
||||||
* @implements Reporter
|
* @implements Reporter
|
||||||
@@ -7177,7 +7181,7 @@ getJasmineRequireObj().ParallelReportDispatcher = function(j$) {
|
|||||||
const ReportDispatcher = deps.ReportDispatcher || j$.ReportDispatcher;
|
const ReportDispatcher = deps.ReportDispatcher || j$.ReportDispatcher;
|
||||||
const QueueRunner = deps.QueueRunner || j$.QueueRunner;
|
const QueueRunner = deps.QueueRunner || j$.QueueRunner;
|
||||||
const globalErrors = deps.globalErrors || new j$.GlobalErrors();
|
const globalErrors = deps.globalErrors || new j$.GlobalErrors();
|
||||||
const dispatcher = ReportDispatcher(
|
const dispatcher = new ReportDispatcher(
|
||||||
j$.reporterEvents,
|
j$.reporterEvents,
|
||||||
function(queueRunnerOptions) {
|
function(queueRunnerOptions) {
|
||||||
queueRunnerOptions = {
|
queueRunnerOptions = {
|
||||||
@@ -7903,6 +7907,8 @@ getJasmineRequireObj().QueueRunner = function(j$) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
getJasmineRequireObj().ReportDispatcher = function(j$) {
|
getJasmineRequireObj().ReportDispatcher = function(j$) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
function ReportDispatcher(methods, queueRunnerFactory, onLateError) {
|
function ReportDispatcher(methods, queueRunnerFactory, onLateError) {
|
||||||
const dispatchedMethods = methods || [];
|
const dispatchedMethods = methods || [];
|
||||||
|
|
||||||
@@ -8479,7 +8485,11 @@ getJasmineRequireObj().interface = function(jasmine, env) {
|
|||||||
* @since 1.3.0
|
* @since 1.3.0
|
||||||
* @function
|
* @function
|
||||||
* @param {String} [name] - Name to give the spy. This will be displayed in failure messages.
|
* @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.
|
* @param {Function} [originalFn] - The "real" function. This will
|
||||||
|
* be used for subsequent calls to the spy after you call
|
||||||
|
* `mySpy.and.callThrough()`. In most cases you should omit this parameter.
|
||||||
|
* The usual way to supply an original function is to call {@link spyOn}
|
||||||
|
* instead of createSpy.
|
||||||
* @return {Spy}
|
* @return {Spy}
|
||||||
*/
|
*/
|
||||||
jasmine.createSpy = function(name, originalFn) {
|
jasmine.createSpy = function(name, originalFn) {
|
||||||
@@ -10802,5 +10812,5 @@ getJasmineRequireObj().UserContext = function(j$) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
getJasmineRequireObj().version = function() {
|
getJasmineRequireObj().version = function() {
|
||||||
return '5.1.0';
|
return '5.1.1';
|
||||||
};
|
};
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "jasmine-core",
|
"name": "jasmine-core",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"version": "5.1.0",
|
"version": "5.1.1",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/jasmine/jasmine.git"
|
"url": "https://github.com/jasmine/jasmine.git"
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
# Jasmine Core 5.1.1 Release Notes
|
||||||
|
|
||||||
|
## Bug Fixes
|
||||||
|
|
||||||
|
* Fixed global variable leak in the main process when running in parallel mode
|
||||||
|
* Removed unnecessary throw when building expectation results
|
||||||
|
|
||||||
|
## Documentation Improvements
|
||||||
|
|
||||||
|
* Improved jsdocs for originalFn argument to createSpy
|
||||||
|
* Link to 5.0 upgrade guide in README, not 4.0
|
||||||
|
|
||||||
|
## Supported environments
|
||||||
|
|
||||||
|
jasmine-core 5.1.1 has been tested in the following environments.
|
||||||
|
|
||||||
|
| Environment | Supported versions |
|
||||||
|
|-------------------|--------------------|
|
||||||
|
| Node | 18, 20 |
|
||||||
|
| Safari | 15-16 |
|
||||||
|
| Chrome | 116 |
|
||||||
|
| Firefox | 102, 116 |
|
||||||
|
| Edge | 115 |
|
||||||
|
|
||||||
|
|
||||||
|
------
|
||||||
|
|
||||||
|
_Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_
|
||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// Warning: don't add "use strict" to this file. Doing so potentially changes
|
||||||
|
// the behavior of user code that does things like setTimeout("var x = 1;")
|
||||||
|
// while the mock clock is installed.
|
||||||
getJasmineRequireObj().DelayedFunctionScheduler = function(j$) {
|
getJasmineRequireObj().DelayedFunctionScheduler = function(j$) {
|
||||||
function DelayedFunctionScheduler() {
|
function DelayedFunctionScheduler() {
|
||||||
this.scheduledLookup_ = [];
|
this.scheduledLookup_ = [];
|
||||||
@@ -23,6 +26,9 @@ getJasmineRequireObj().DelayedFunctionScheduler = function(j$) {
|
|||||||
) {
|
) {
|
||||||
let f;
|
let f;
|
||||||
if (typeof funcToCall === 'string') {
|
if (typeof funcToCall === 'string') {
|
||||||
|
// setTimeout("some code") and setInterval("some code") are legal, if
|
||||||
|
// not recommended. We don't do that ourselves, but user code might.
|
||||||
|
// This allows such code to work when the mock clock is installed.
|
||||||
f = function() {
|
f = function() {
|
||||||
// eslint-disable-next-line no-eval
|
// eslint-disable-next-line no-eval
|
||||||
return eval(funcToCall);
|
return eval(funcToCall);
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
getJasmineRequireObj().ParallelReportDispatcher = function(j$) {
|
getJasmineRequireObj().ParallelReportDispatcher = function(j$) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @class ParallelReportDispatcher
|
* @class ParallelReportDispatcher
|
||||||
* @implements Reporter
|
* @implements Reporter
|
||||||
@@ -17,7 +19,7 @@ getJasmineRequireObj().ParallelReportDispatcher = function(j$) {
|
|||||||
const ReportDispatcher = deps.ReportDispatcher || j$.ReportDispatcher;
|
const ReportDispatcher = deps.ReportDispatcher || j$.ReportDispatcher;
|
||||||
const QueueRunner = deps.QueueRunner || j$.QueueRunner;
|
const QueueRunner = deps.QueueRunner || j$.QueueRunner;
|
||||||
const globalErrors = deps.globalErrors || new j$.GlobalErrors();
|
const globalErrors = deps.globalErrors || new j$.GlobalErrors();
|
||||||
const dispatcher = ReportDispatcher(
|
const dispatcher = new ReportDispatcher(
|
||||||
j$.reporterEvents,
|
j$.reporterEvents,
|
||||||
function(queueRunnerOptions) {
|
function(queueRunnerOptions) {
|
||||||
queueRunnerOptions = {
|
queueRunnerOptions = {
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
getJasmineRequireObj().ReportDispatcher = function(j$) {
|
getJasmineRequireObj().ReportDispatcher = function(j$) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
function ReportDispatcher(methods, queueRunnerFactory, onLateError) {
|
function ReportDispatcher(methods, queueRunnerFactory, onLateError) {
|
||||||
const dispatchedMethods = methods || [];
|
const dispatchedMethods = methods || [];
|
||||||
|
|
||||||
|
|||||||
@@ -69,11 +69,7 @@ getJasmineRequireObj().buildExpectationResult = function(j$) {
|
|||||||
} else if (options.stack) {
|
} else if (options.stack) {
|
||||||
error = options;
|
error = options;
|
||||||
} else {
|
} else {
|
||||||
try {
|
error = new Error(message());
|
||||||
throw new Error(message());
|
|
||||||
} catch (e) {
|
|
||||||
error = e;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Omit the message from the stack trace because it will be
|
// Omit the message from the stack trace because it will be
|
||||||
|
|||||||
@@ -423,7 +423,11 @@ getJasmineRequireObj().interface = function(jasmine, env) {
|
|||||||
* @since 1.3.0
|
* @since 1.3.0
|
||||||
* @function
|
* @function
|
||||||
* @param {String} [name] - Name to give the spy. This will be displayed in failure messages.
|
* @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.
|
* @param {Function} [originalFn] - The "real" function. This will
|
||||||
|
* be used for subsequent calls to the spy after you call
|
||||||
|
* `mySpy.and.callThrough()`. In most cases you should omit this parameter.
|
||||||
|
* The usual way to supply an original function is to call {@link spyOn}
|
||||||
|
* instead of createSpy.
|
||||||
* @return {Spy}
|
* @return {Spy}
|
||||||
*/
|
*/
|
||||||
jasmine.createSpy = function(name, originalFn) {
|
jasmine.createSpy = function(name, originalFn) {
|
||||||
|
|||||||
Reference in New Issue
Block a user