Compare commits

...

19 Commits

Author SHA1 Message Date
Steve Gravrock
7379a3a11b Bump version to 6.0.1
Some checks failed
Test in latest available Safari / build (push) Has been cancelled
2026-01-19 07:59:36 -08:00
Steve Gravrock
066669cfee Revert "Temporarily (I hope) disable testing against Safari 16 and 17"
This reverts commit 6755b03f12.
2026-01-18 20:51:20 -08:00
Steve Gravrock
87177d9d43 Fix browser ESM deprecation wraning
Previously, the warning was issued if jasmineRequire.core was called from
an ES module rather than being defined in an ES module.
2026-01-17 17:12:32 -08:00
Steve Gravrock
0c75a154a8 Fix typo 2026-01-17 12:00:58 -08:00
Steve Gravrock
0a6f6d2b0e Bump version to 6.0.0
Some checks failed
Test in latest available Safari / build (push) Has been cancelled
2026-01-17 11:35:56 -08:00
Steve Gravrock
6755b03f12 Temporarily (I hope) disable testing against Safari 16 and 17
Saucelabs VMs for these browsers currently fail to start. There was a
successful run last night against commit e759ddced2.
2026-01-17 11:25:22 -08:00
Steve Gravrock
e759ddced2 Clarify monkey patching deprecation warning 2026-01-11 19:23:51 -08:00
Steve Gravrock
1ad28d8515 Update copyright date 2026-01-11 19:23:25 -08:00
Steve Gravrock
3d36b11c8f rm bogus @optional jsdoc tags 2025-12-30 12:18:22 -08:00
Steve Gravrock
a15df6d455 Document that globals may be overwritten 2025-12-30 12:15:33 -08:00
Steve Gravrock
9f0488dc32 Bump version to 6.0.0-beta.1
Some checks failed
Test in latest available Safari / build (push) Has been cancelled
2025-12-06 10:56:56 -08:00
Steve Gravrock
f3dba82b04 Revert to using window.onload
To support top level await, jasmine-browser-runner needs to be able
to delay env execution until after spec files have initialized. The
old-fashioned event listener style makes that straightforward.
2025-12-01 18:33:08 -08:00
Steve Gravrock
c999ce0787 Update some dev dependencies 2025-12-01 17:57:37 -08:00
Steve Gravrock
5b76bf9552 Merge branch '6.0' 2025-12-01 17:48:49 -08:00
Steve Gravrock
9cf9b856b0 Bump version to 5.13.0
Some checks failed
Test in latest available Safari / build (push) Has been cancelled
2025-12-01 17:25:03 -08:00
Steve Gravrock
db6c142afd Copy 6.0.0-beta.0 release notes from branch 2025-11-28 11:49:05 -08:00
Steve Gravrock
1e691b2470 Prettier 2025-11-27 06:53:27 -08:00
Steve Gravrock
c5555dd8cc Better debug logging for spec that occasionally fails in FF 2025-11-27 06:30:09 -08:00
Steve Gravrock
78c14f81a8 Copy 6.0.0-alpha.2 release notes from branch 2025-11-15 14:40:39 -08:00
18 changed files with 406 additions and 31 deletions

View File

@@ -1,5 +1,5 @@
Copyright (c) 2008-2019 Pivotal Labs
Copyright (c) 2008-2025 The Jasmine developers
Copyright (c) 2008-2026 The Jasmine developers
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the

View File

@@ -60,5 +60,5 @@ To find out what environments work with a particular Jasmine release, see the [r
* Sheel Choksi
Copyright (c) 2008-2019 Pivotal Labs<br>
Copyright (c) 2008-2025 The Jasmine developers<br>
Copyright (c) 2008-2026 The Jasmine developers<br>
This software is licensed under the [MIT License](https://github.com/jasmine/jasmine/blob/main/LICENSE).

View File

@@ -1,6 +1,6 @@
/*
Copyright (c) 2008-2019 Pivotal Labs
Copyright (c) 2008-2025 The Jasmine developers
Copyright (c) 2008-2026 The Jasmine developers
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the

View File

@@ -1,6 +1,6 @@
/*
Copyright (c) 2008-2019 Pivotal Labs
Copyright (c) 2008-2025 The Jasmine developers
Copyright (c) 2008-2026 The Jasmine developers
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the

View File

@@ -1,6 +1,6 @@
/*
Copyright (c) 2008-2019 Pivotal Labs
Copyright (c) 2008-2025 The Jasmine developers
Copyright (c) 2008-2026 The Jasmine developers
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
@@ -49,11 +49,16 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
env.configure(urls.configFromCurrentUrl());
window.addEventListener('load', function() {
const currentWindowOnload = window.onload;
window.onload = function() {
if (currentWindowOnload) {
currentWindowOnload();
}
// The HTML reporter needs to be set up here so it can access the DOM. Other
// reporters can be added at any time before env.execute() is called.
const htmlReporter = new jasmine.HtmlReporterV2({ env, urls });
env.addReporter(htmlReporter);
env.execute();
});
};
})();

View File

@@ -1,6 +1,6 @@
/*
Copyright (c) 2008-2019 Pivotal Labs
Copyright (c) 2008-2025 The Jasmine developers
Copyright (c) 2008-2026 The Jasmine developers
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the

View File

@@ -1,6 +1,6 @@
/*
Copyright (c) 2008-2019 Pivotal Labs
Copyright (c) 2008-2025 The Jasmine developers
Copyright (c) 2008-2026 The Jasmine developers
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
@@ -43,6 +43,9 @@ var getJasmineRequireObj = (function() {
return jasmineRequire;
}
const loadedAsBrowserEsm =
globalThis.document && !globalThis.document.currentScript;
getJasmineRequire().core = function(jRequire) {
const j$ = {};
Object.defineProperty(j$, 'private', {
@@ -124,8 +127,7 @@ var getJasmineRequireObj = (function() {
j$.private.matchers = jRequire.requireMatchers(jRequire, j$);
j$.private.asyncMatchers = jRequire.requireAsyncMatchers(jRequire, j$);
j$.private.loadedAsBrowserEsm =
globalThis.document && !globalThis.document.currentScript;
j$.private.loadedAsBrowserEsm = loadedAsBrowserEsm;
j$.private.deprecateMonkeyPatching(j$, [
// These are meant to be set by users.
@@ -3870,7 +3872,7 @@ getJasmineRequireObj().deprecateMonkeyPatching = function(j$) {
},
set(newValue) {
j$.getEnv().deprecated(
'Monkey patching detected. This is not supported and will break in a future jasmine-core release.'
'Monkey patching detected. Code that overwrites parts of Jasmine, except globala and other properties that are documented as writeable, is not supported and will break in a future release.'
);
value = newValue;
}
@@ -8961,7 +8963,6 @@ getJasmineRequireObj().reporterEvents = function(j$) {
* {@link ReporterCapabilities} will apply.
* @name Reporter#reporterCapabilities
* @type ReporterCapabilities | undefined
* @optional
* @since 5.0
*/
/**
@@ -9028,7 +9029,6 @@ getJasmineRequireObj().reporterEvents = function(j$) {
/**
* `specStarted` is invoked when an `it` starts to run (including associated `beforeEach` functions)
* @function
* @optional
* @name Reporter#specStarted
* @param {SpecStartedEvent} result Information about the individual {@link it} being run
* @param {Function} [done] Used to specify to Jasmine that this callback is asynchronous and Jasmine should wait until it has been called before moving on.
@@ -9075,6 +9075,7 @@ getJasmineRequireObj().interface = function(jasmine, env) {
* @since 1.3.0
* @function
* @global
* @overwritable
* @param {String} description Textual description of the group
* @param {Function} specDefinitions Function for Jasmine to invoke that will define inner suites and specs
*/
@@ -9090,6 +9091,7 @@ getJasmineRequireObj().interface = function(jasmine, env) {
* @since 1.3.0
* @function
* @global
* @overwritable
* @param {String} description Textual description of the group
* @param {Function} specDefinitions Function for Jasmine to invoke that will define inner suites and specs
*/
@@ -9106,6 +9108,7 @@ getJasmineRequireObj().interface = function(jasmine, env) {
* @since 2.1.0
* @function
* @global
* @overwritable
* @param {String} description Textual description of the group
* @param {Function} specDefinitions Function for Jasmine to invoke that will define inner suites and specs
*/
@@ -9124,6 +9127,7 @@ getJasmineRequireObj().interface = function(jasmine, env) {
* @since 1.3.0
* @function
* @global
* @overwritable
* @param {String} description Textual description of what this spec is checking
* @param {implementationCallback} [testFunction] Function that contains the code of your test. If not provided the test will be `pending`.
* @param {Int} [timeout={@link jasmine.DEFAULT_TIMEOUT_INTERVAL}] Custom timeout for an async spec.
@@ -9141,6 +9145,7 @@ getJasmineRequireObj().interface = function(jasmine, env) {
* @since 1.3.0
* @function
* @global
* @overwritable
* @param {String} description Textual description of what this spec is checking.
* @param {implementationCallback} [testFunction] Function that contains the code of your test. Will not be executed.
*/
@@ -9156,6 +9161,7 @@ getJasmineRequireObj().interface = function(jasmine, env) {
* @since 2.1.0
* @function
* @global
* @overwritable
* @param {String} description Textual description of what this spec is checking.
* @param {implementationCallback} testFunction Function that contains the code of your test.
* @param {Int} [timeout={@link jasmine.DEFAULT_TIMEOUT_INTERVAL}] Custom timeout for an async spec.
@@ -9171,6 +9177,7 @@ getJasmineRequireObj().interface = function(jasmine, env) {
* @since 1.3.0
* @function
* @global
* @overwritable
* @param {implementationCallback} [function] Function that contains the code to setup your specs.
* @param {Int} [timeout={@link jasmine.DEFAULT_TIMEOUT_INTERVAL}] Custom timeout for an async beforeEach.
* @see async
@@ -9185,6 +9192,7 @@ getJasmineRequireObj().interface = function(jasmine, env) {
* @since 1.3.0
* @function
* @global
* @overwritable
* @param {implementationCallback} [function] Function that contains the code to teardown your specs.
* @param {Int} [timeout={@link jasmine.DEFAULT_TIMEOUT_INTERVAL}] Custom timeout for an async afterEach.
* @see async
@@ -9201,6 +9209,7 @@ getJasmineRequireObj().interface = function(jasmine, env) {
* @since 2.1.0
* @function
* @global
* @overwritable
* @param {implementationCallback} [function] Function that contains the code to setup your specs.
* @param {Int} [timeout={@link jasmine.DEFAULT_TIMEOUT_INTERVAL}] Custom timeout for an async beforeAll.
* @see async
@@ -9217,6 +9226,7 @@ getJasmineRequireObj().interface = function(jasmine, env) {
* @since 2.1.0
* @function
* @global
* @overwritable
* @param {implementationCallback} [function] Function that contains the code to teardown your specs.
* @param {Int} [timeout={@link jasmine.DEFAULT_TIMEOUT_INTERVAL}] Custom timeout for an async afterAll.
* @see async
@@ -9230,6 +9240,8 @@ getJasmineRequireObj().interface = function(jasmine, env) {
* @name getSpecProperty
* @since 5.10.0
* @function
* @global
* @overwritable
* @param {String} key The name of the property
* @returns {*} The value of the property
*/
@@ -9242,6 +9254,8 @@ getJasmineRequireObj().interface = function(jasmine, env) {
* @name setSpecProperty
* @since 3.6.0
* @function
* @global
* @overwritable
* @param {String} key The name of the property
* @param {*} value The value of the property
*/
@@ -9254,6 +9268,8 @@ getJasmineRequireObj().interface = function(jasmine, env) {
* @name setSuiteProperty
* @since 3.6.0
* @function
* @global
* @overwritable
* @param {String} key The name of the property
* @param {*} value The value of the property
*/
@@ -9267,6 +9283,7 @@ getJasmineRequireObj().interface = function(jasmine, env) {
* @since 1.3.0
* @function
* @global
* @overwritable
* @param {Object} actual - Actual computed value to test expectations against.
* @return {matchers}
*/
@@ -9283,6 +9300,7 @@ getJasmineRequireObj().interface = function(jasmine, env) {
* @since 3.3.0
* @function
* @global
* @overwritable
* @param {Object} actual - Actual computed value to test expectations against.
* @return {async-matchers}
* @example
@@ -9309,8 +9327,8 @@ getJasmineRequireObj().interface = function(jasmine, env) {
* @name throwUnlessAsync
* @since 5.1.0
* @function
* @param actual
* @global
* @overwritable
* @param {Object} actual - Actual computed value to test expectations against.
* @return {matchers}
*/
@@ -9333,8 +9351,8 @@ getJasmineRequireObj().interface = function(jasmine, env) {
* @name throwUnless
* @since 5.1.0
* @function
* @param actual
* @global
* @overwritable
* @param {Object} actual - Actual computed value to test expectations against.
* @return {matchers}
*/
@@ -9348,6 +9366,7 @@ getJasmineRequireObj().interface = function(jasmine, env) {
* @since 2.0.0
* @function
* @global
* @overwritable
* @param {String} [message] - Reason the spec is pending.
*/
pending: function() {
@@ -9360,6 +9379,7 @@ getJasmineRequireObj().interface = function(jasmine, env) {
* @since 2.1.0
* @function
* @global
* @overwritable
* @param {String|Error} [error] - Reason for the failure.
*/
fail: function() {
@@ -9372,6 +9392,7 @@ getJasmineRequireObj().interface = function(jasmine, env) {
* @since 1.3.0
* @function
* @global
* @overwritable
* @param {Object} obj - The object upon which to install the {@link Spy}.
* @param {String} methodName - The name of the method to replace with a {@link Spy}.
* @returns {Spy}
@@ -9386,6 +9407,7 @@ getJasmineRequireObj().interface = function(jasmine, env) {
* @since 2.6.0
* @function
* @global
* @overwritable
* @param {Object} obj - The object upon which to install the {@link Spy}
* @param {String} propertyName - The name of the property to replace with a {@link Spy}.
* @param {String} [accessType=get] - The access type (get|set) of the property to {@link Spy} on.
@@ -9401,6 +9423,7 @@ getJasmineRequireObj().interface = function(jasmine, env) {
* @since 3.2.1
* @function
* @global
* @overwritable
* @param {Object} obj - The object upon which to install the {@link Spy}s
* @param {boolean} includeNonEnumerable - Whether or not to add spies to non-enumerable properties
* @returns {Object} the spied object
@@ -12385,5 +12408,5 @@ getJasmineRequireObj().UserContext = function(j$) {
};
getJasmineRequireObj().version = function() {
return '6.0.0-beta.0';
return '6.0.1';
};

View File

@@ -1,7 +1,7 @@
{
"name": "jasmine-core",
"license": "MIT",
"version": "6.0.0-beta.0",
"version": "6.0.1",
"repository": {
"type": "git",
"url": "https://github.com/jasmine/jasmine.git"
@@ -43,10 +43,10 @@
"ejs": "^3.1.10",
"eslint": "^9.24.0",
"eslint-plugin-compat": "^6.0.2",
"glob": "^10.2.3",
"glob": "^13.0.0",
"globals": "^16.0.0",
"jasmine": "github:jasmine/jasmine-npm#6.0",
"jasmine-browser-runner": "github:jasmine/jasmine-browser-runner#4.0",
"jasmine": "github:jasmine/jasmine-npm",
"jasmine-browser-runner": "github:jasmine/jasmine-browser-runner",
"jsdom": "^26.0.0",
"prettier": "1.17.1",
"sass": "^1.58.3"

44
release_notes/5.13.0.md Normal file
View File

@@ -0,0 +1,44 @@
# Jasmine Core 5.13.0 Release Notes
## Changes to supported environments
Safari 26 is now supported on a best-effort basis.
Due to the limited availability of Safari 18 and later on free CI services,
Safari support in future jasmine-core versions will be limited to:
* Best-effort support for the latest Safari version available on GitHub Actions,
which may change at any time.
* Best-effort support for Safari 16 and 17 for as long as it remains practical.
## New Features
* New `extraItStackFrames` and `extraDescribeStackFrames` config options to fix
the filename properties of reporter events in configurations that wrap
`it`/`describe`, such as zone.js. The `filename` properties of reporter events
are no longer deprecated.
* `jasmine.allOf` asymmetric equality tester
* Merges [#2087](https://github.com/jasmine/jasmine/issues/2083) from @jonahd-g
* Fixes [#2083](https://github.com/jasmine/jasmine/pull/2087)
## Supported environments
This version has been tested in the following environments.
| Environment | Supported versions |
|-------------|--------------------------------|
| Node | 18.20.5**, 20, 22, 24 |
| Safari** | 16, 17, 26.1 |
| Chrome | 142* |
| Firefox | 102**, 115**, 128**, 140, 145* |
| Edge | 142* |
\* Evergreen browser. Each version of Jasmine is tested against the latest
version available at release time.<br>
\** Supported on a best-effort basis. Support for these versions may be dropped
if it becomes impractical, and bugs affecting only these versions may not be
treated as release blockers.
------
_Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_

View File

@@ -0,0 +1,47 @@
# Jasmine Core 6.0.0-beta.1 Release Notes
This is a pre-release, intended to offer a preview of upcoming changes and to
solicit feedback.
A corresponding release of the `jasmine` package is not planned because the
change in this release only affects browser users.
## A Note About Pre-Release Compatibility
There may be additional breaking changes in future 6.0 pre-releases or in the
final 6.0 release. That's allowed by the semver specification, but users are
sometimes unpleasantly surprised by it.
NPM's implementation of carat version ranges assumes that subsequent
pre-releases and final releases are fully compatible with earlier pre-releases.
If your package.json contains `"jasmine-core": "^6.0.0-beta.1`,
NPM might install any later 6.x version even though there is no guarantee of
compatibility. If that isn't ok, you should specify an exact pre-release version:
`"jasmine-core": "6.0.0-beta.1`.
## Bug Fixes
* Revert to using window.onload in boot1.js. This fixes top level await in
jasmine-browser-runner.
## Supported environments
This version has been tested in the following environments.
| Environment | Supported versions |
|-------------------|--------------------------------|
| Node | 20, 22, 24 |
| Safari** | 16, 17, 26.1 |
| Chrome | 143* |
| Firefox | 102**, 115**, 128**, 140, 145* |
| Edge | 142* |
\* Evergreen browser. Each version of Jasmine is tested against the latest
version available at release time.<br>
\** Supported on a best-effort basis. Support for these versions may be dropped
if it becomes impractical, and bugs affecting only these versions may not be
treated as release blockers.
------
_Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_

190
release_notes/6.0.0.md Normal file
View File

@@ -0,0 +1,190 @@
# Jasmine Core 6.0.0 Release Notes
## Summary
This is a major release that includes breaking changes as well as significant
new features. Many of the breaking changes and deprecations in this release are
intended to improve the stability of the Jasmine ecosystem by making the
distinction between public and private APIs more obvious, reducing exposure of
jasmine-core's internal state, removing ambiguities from the reporter API, and
warning about monkey patching.
6.x is intended to ba a relatively short-lived, transitional series. It is
compatible with the current versions of karma-jasmine and other legacy Angular
tools but emits deprecation warnings when used with them. 7.0 will drop
compatibility with those tools. If you use Karma in a non-Angular context,
consider migrating to a maintained alternative such as jasmine-browser-runner or
web-test-runner. If you use Angular, please direct any questions about support
for future versions of Jasmine to the Angular team.
Please see the [migration guide](https://jasmine.github.io/upgrade-guides/6.0)
for more information. If you use Jasmine via the `jasmine` package, please see
[its release notes](https://github.com/jasmine/jasmine-npm/blob/main/release_notes/6.0.0.md)
as well.
## Changes to supported environments
* Node 18 is no longer supported.
## Breaking changes
### General
* Private APIs have been removed from the `jasmine` namespace.
The purpose of this change is to reduce the risk of users inadvertently
depending on private APIs. Anything not covered by
[the documentation](https://jasmine.github.io/pages/docs_home.html) remains
private regardless of namespacing. Private APIs may be changed or removed in
any release. This change is being made in a major release as a courtesy to
users of libraries that depend on private APIs.
### Changes that affect spec writing
* Global error spies always receive a single argument. Previously, the browser
error event was passed as the second argument.
* If a spy is invoked via `.call(null, ...)` or `.apply(null, ...)`, the spy's
`this` argument will be `null`. Previously it was `globalThis`.
* Mock clock timing functions cannot be spied on. Previously this "worked" but
prevented the mock clock from uninstalling itself.
* The mock clock no longer supports the eval forms of `setTimeout` and
`setInterval`.
* Keys passed to `setSpecProperty`/`setSuiteProperty` must be strings. Values
must be both structured-cloneable and JSON-serializable.
### Changes that affect configuration
* HTML reporters cache configuration throughout each run. Configuration changes
made while specs are running will not affect reporter behavior.
* If an execution order is passed to `Env#execute`, it must not enter any suite
more than once.
* The argument passed to spec filters is a
[spec metadata](https://jasmine.github.io/api/6.0/Spec.html)
instance, not the internal spec object.
* The default value of the `forbidDuplicateNames` config option has been
changed to true.
### Changes that affect reporters
This release includes changes that are intended to streamline and clarify the
reporter interface, prevent sharing of mutable state, and prevent bugs involving
non-serializable objects. These changes should be compatible with most existing
reporters but could break reporters that manage their internal state in unusual
ways.
* Meaningless properties such as `status` and `failedExpectations` are omitted
from the events passed to [suiteStarted](https://jasmine.github.io/api/6.0/global.html#SuiteStartedEvent)
and [specStarted](https://jasmine.github.io/api/6.0/global.html#SpecStartedEvent).
* Reporter events are deep-cloned before being passed to each reporter. This
protects reporters against later mutation by jasmine-core or other reporters.
* The `expected` and `actual` properties of
[passed and failed expectations](https://jasmine.github.io/api/6.0/global.html#ExpectationResult)
have been removed.
* The [order](https://jasmine.github.io/api/6.0/global.html#Order)
property of the`jasmineStarted` and `jasmineDone` reporter events no longer
includes undocumented properties.
* boot1.js no longer adds `jsApiReporter` to the env.
### Changes that affect browser boot files
* The `createElement` and `createTextNode` options of the legacy `HtmlReporter`
are ignored. `HtmlReporter` now unconditionally uses `document.createElement`
and `document.createTextNode`.
### Changes to Node boot functions
* [boot](https://jasmine.github.io/api/6.0/module-jasmine-core.html#.boot)
defaults to creating a new core instance each time it's called. This restores
the pre-5.0 default behavior.
* [noGlobals](https://jasmine.github.io/api/6.0/module-jasmine-core.html#.noGlobals)
no longer takes a parameter. It always returns the same object when called
repeatedly.
## New features
* A new `HtmlReporterV2` with several improvements over the old `HtmlReporter`:
* Clicking a spec/suite link does exact filtering rather than a substring
match.
* The old dots are replaced with a progress bar. This improves usability with
large suites and fixes an accessibility problem.
* Details of failed specs are displayed as soon as each spec finishes.
* A Performance tab shows metrics and a list of the slowest specs.
* Initialization and wire-up in boot files are much simpler.
If you're using jasmine-browser-runner or copying boot1.js from the standalone
distribution, you'll automatically get the new reporter. If you maintain your
own boot files, you'll get the old reporter unless you update your boot files
to match the one that's in this package.
The new reporter produces `spec` query string parameters that are different
from those created by the old reporter. If you use other software that
interprets the `spec` parameter, such as karma-jasmine, you won't be able to
adopt `HtmlReporterV2` unlesss that other software is updated.
* Larger body font size in HTML reporters
* `globalThis` is used to determine the global object during initialization
This makes jasmine-core more tolerant of buggy bundlers or loaders that
cause `this` to be undefined in the global context.
* Experimental [`safariYieldStrategy: "time"`](https://jasmine.github.io/api/6.0/Configuration.html#safariYieldStrategy)
config option, which may make Jasmine run significantly faster in Safari and
similar browsers. So far, this option has not been tested on a wide variety of
workloads. Feedback is appreciated.
* Statically exposed pretty printer as `jasmine.pp()`.
## Deprecations
* Common monkey patching patterns are detected and result in a deprecation
warning. Code that overwrites anything provided by jasmine-core (other than
globals like `it`/`expect`/etc or configuration properties like
`jasmine.DEFAULT_TIMEOUT_INTERVAL`) may be broken by any jasmine-core release.
* Warn if jasmine-core is loaded as an ES module in a browser.
This is an untested and unsupported configuration that has been known to cause
problems.
* `HtmlReporter` and `HtmlSpecFilter` are deprecated in favor of `HtmlReporterV2`.
* `jsApiReporter` is deprecated.
## Documentation improvements
* Improved API reference documentation for APIs that are used from browser boot
files.
* Documented the set of possible spec statuses.
* Documented that globals are overwriteable.
## Internal improvements
* Encapsulated suite and spec result and status management.
* Adopted strict mode throughout the codebase.
* Decomposed `HtmlReporter` into components and converted to ES6 classes.
* Made global error handling more uniform between browsers and Node.
* Removed code to support browsers that don't have `MessageChannel`. Jasmine
hasn't run in any such browsers since 2.x.
* Replaced `isArray` helper with native `Array.isArray`.
## Supported environments
This version has been tested in the following environments.
| Environment | Supported versions |
|-------------------|--------------------------------|
| Node | 20, 22, 24 |
| Safari** | 16, 17, 26.2 |
| Chrome | 143* |
| Firefox | 102**, 115**, 128**, 140, 147* |
| Edge | 143* |
\* Evergreen browser. Each version of Jasmine is tested against the latest
version available at release time.<br>
\** Supported on a best-effort basis. Support for these versions may be dropped
if it becomes impractical, and bugs affecting only these versions may not be
treated as release blockers.
------
_Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_

29
release_notes/6.0.1.md Normal file
View File

@@ -0,0 +1,29 @@
# Jasmine Core 6.0.1 Release Notes
## Bug fixes
* Don't emit a deprecation warning when `jasmineRequire.core` is called from an
ES module
## Supported environments
This version has been tested in the following environments.
| Environment | Supported versions |
|-------------------|--------------------------------|
| Node | 20, 22, 24 |
| Safari** | 16, 17, 26.2 |
| Chrome | 143* |
| Firefox | 102**, 115**, 128**, 140, 147* |
| Edge | 143* |
\* Evergreen browser. Each version of Jasmine is tested against the latest
version available at release time.<br>
\** Supported on a best-effort basis. Support for these versions may be dropped
if it becomes impractical, and bugs affecting only these versions may not be
treated as release blockers.
------
_Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_

View File

@@ -768,7 +768,16 @@ describe('matchersUtil', function() {
a2[0] = 1;
const diffBuilder = new privateUnderTest.DiffBuilder();
expect(matchersUtil.equals(a1, a2, diffBuilder)).toBe(false);
jasmine.debugLog('Diff: ' + diffBuilder.getMessage());
jasmine.debugLog(
'a1 keys: ' + jasmine.pp(privateUnderTest.MatchersUtil.keys(a1))
);
jasmine.debugLog(
'a2 keys: ' + jasmine.pp(privateUnderTest.MatchersUtil.keys(a2))
);
jasmine.debugLog('a1 length:' + a1.length);
jasmine.debugLog('a2 length:' + a2.length);
jasmine.debugLog('a1[0]: ' + a1[0]);
jasmine.debugLog('a2[0]: ' + a2[0]);
}
);

View File

@@ -25,11 +25,16 @@
*/
env.configure(urls.configFromCurrentUrl());
window.addEventListener('load', function() {
const currentWindowOnload = window.onload;
window.onload = function() {
if (currentWindowOnload) {
currentWindowOnload();
}
// The HTML reporter needs to be set up here so it can access the DOM. Other
// reporters can be added at any time before env.execute() is called.
const htmlReporter = new jasmine.HtmlReporterV2({ env, urls });
env.addReporter(htmlReporter);
env.execute();
});
};
})();

View File

@@ -11,7 +11,7 @@ getJasmineRequireObj().deprecateMonkeyPatching = function(j$) {
},
set(newValue) {
j$.getEnv().deprecated(
'Monkey patching detected. This is not supported and will break in a future jasmine-core release.'
'Monkey patching detected. Code that overwrites parts of Jasmine, except globala and other properties that are documented as writeable, is not supported and will break in a future release.'
);
value = newValue;
}

View File

@@ -7,7 +7,6 @@ getJasmineRequireObj().reporterEvents = function(j$) {
* {@link ReporterCapabilities} will apply.
* @name Reporter#reporterCapabilities
* @type ReporterCapabilities | undefined
* @optional
* @since 5.0
*/
/**
@@ -74,7 +73,6 @@ getJasmineRequireObj().reporterEvents = function(j$) {
/**
* `specStarted` is invoked when an `it` starts to run (including associated `beforeEach` functions)
* @function
* @optional
* @name Reporter#specStarted
* @param {SpecStartedEvent} result Information about the individual {@link it} being run
* @param {Function} [done] Used to specify to Jasmine that this callback is asynchronous and Jasmine should wait until it has been called before moving on.

View File

@@ -19,6 +19,9 @@ var getJasmineRequireObj = (function() {
return jasmineRequire;
}
const loadedAsBrowserEsm =
globalThis.document && !globalThis.document.currentScript;
getJasmineRequire().core = function(jRequire) {
const j$ = {};
Object.defineProperty(j$, 'private', {
@@ -100,8 +103,7 @@ var getJasmineRequireObj = (function() {
j$.private.matchers = jRequire.requireMatchers(jRequire, j$);
j$.private.asyncMatchers = jRequire.requireAsyncMatchers(jRequire, j$);
j$.private.loadedAsBrowserEsm =
globalThis.document && !globalThis.document.currentScript;
j$.private.loadedAsBrowserEsm = loadedAsBrowserEsm;
j$.private.deprecateMonkeyPatching(j$, [
// These are meant to be set by users.

View File

@@ -20,6 +20,7 @@ getJasmineRequireObj().interface = function(jasmine, env) {
* @since 1.3.0
* @function
* @global
* @overwritable
* @param {String} description Textual description of the group
* @param {Function} specDefinitions Function for Jasmine to invoke that will define inner suites and specs
*/
@@ -35,6 +36,7 @@ getJasmineRequireObj().interface = function(jasmine, env) {
* @since 1.3.0
* @function
* @global
* @overwritable
* @param {String} description Textual description of the group
* @param {Function} specDefinitions Function for Jasmine to invoke that will define inner suites and specs
*/
@@ -51,6 +53,7 @@ getJasmineRequireObj().interface = function(jasmine, env) {
* @since 2.1.0
* @function
* @global
* @overwritable
* @param {String} description Textual description of the group
* @param {Function} specDefinitions Function for Jasmine to invoke that will define inner suites and specs
*/
@@ -69,6 +72,7 @@ getJasmineRequireObj().interface = function(jasmine, env) {
* @since 1.3.0
* @function
* @global
* @overwritable
* @param {String} description Textual description of what this spec is checking
* @param {implementationCallback} [testFunction] Function that contains the code of your test. If not provided the test will be `pending`.
* @param {Int} [timeout={@link jasmine.DEFAULT_TIMEOUT_INTERVAL}] Custom timeout for an async spec.
@@ -86,6 +90,7 @@ getJasmineRequireObj().interface = function(jasmine, env) {
* @since 1.3.0
* @function
* @global
* @overwritable
* @param {String} description Textual description of what this spec is checking.
* @param {implementationCallback} [testFunction] Function that contains the code of your test. Will not be executed.
*/
@@ -101,6 +106,7 @@ getJasmineRequireObj().interface = function(jasmine, env) {
* @since 2.1.0
* @function
* @global
* @overwritable
* @param {String} description Textual description of what this spec is checking.
* @param {implementationCallback} testFunction Function that contains the code of your test.
* @param {Int} [timeout={@link jasmine.DEFAULT_TIMEOUT_INTERVAL}] Custom timeout for an async spec.
@@ -116,6 +122,7 @@ getJasmineRequireObj().interface = function(jasmine, env) {
* @since 1.3.0
* @function
* @global
* @overwritable
* @param {implementationCallback} [function] Function that contains the code to setup your specs.
* @param {Int} [timeout={@link jasmine.DEFAULT_TIMEOUT_INTERVAL}] Custom timeout for an async beforeEach.
* @see async
@@ -130,6 +137,7 @@ getJasmineRequireObj().interface = function(jasmine, env) {
* @since 1.3.0
* @function
* @global
* @overwritable
* @param {implementationCallback} [function] Function that contains the code to teardown your specs.
* @param {Int} [timeout={@link jasmine.DEFAULT_TIMEOUT_INTERVAL}] Custom timeout for an async afterEach.
* @see async
@@ -146,6 +154,7 @@ getJasmineRequireObj().interface = function(jasmine, env) {
* @since 2.1.0
* @function
* @global
* @overwritable
* @param {implementationCallback} [function] Function that contains the code to setup your specs.
* @param {Int} [timeout={@link jasmine.DEFAULT_TIMEOUT_INTERVAL}] Custom timeout for an async beforeAll.
* @see async
@@ -162,6 +171,7 @@ getJasmineRequireObj().interface = function(jasmine, env) {
* @since 2.1.0
* @function
* @global
* @overwritable
* @param {implementationCallback} [function] Function that contains the code to teardown your specs.
* @param {Int} [timeout={@link jasmine.DEFAULT_TIMEOUT_INTERVAL}] Custom timeout for an async afterAll.
* @see async
@@ -175,6 +185,8 @@ getJasmineRequireObj().interface = function(jasmine, env) {
* @name getSpecProperty
* @since 5.10.0
* @function
* @global
* @overwritable
* @param {String} key The name of the property
* @returns {*} The value of the property
*/
@@ -187,6 +199,8 @@ getJasmineRequireObj().interface = function(jasmine, env) {
* @name setSpecProperty
* @since 3.6.0
* @function
* @global
* @overwritable
* @param {String} key The name of the property
* @param {*} value The value of the property
*/
@@ -199,6 +213,8 @@ getJasmineRequireObj().interface = function(jasmine, env) {
* @name setSuiteProperty
* @since 3.6.0
* @function
* @global
* @overwritable
* @param {String} key The name of the property
* @param {*} value The value of the property
*/
@@ -212,6 +228,7 @@ getJasmineRequireObj().interface = function(jasmine, env) {
* @since 1.3.0
* @function
* @global
* @overwritable
* @param {Object} actual - Actual computed value to test expectations against.
* @return {matchers}
*/
@@ -228,6 +245,7 @@ getJasmineRequireObj().interface = function(jasmine, env) {
* @since 3.3.0
* @function
* @global
* @overwritable
* @param {Object} actual - Actual computed value to test expectations against.
* @return {async-matchers}
* @example
@@ -254,8 +272,8 @@ getJasmineRequireObj().interface = function(jasmine, env) {
* @name throwUnlessAsync
* @since 5.1.0
* @function
* @param actual
* @global
* @overwritable
* @param {Object} actual - Actual computed value to test expectations against.
* @return {matchers}
*/
@@ -278,8 +296,8 @@ getJasmineRequireObj().interface = function(jasmine, env) {
* @name throwUnless
* @since 5.1.0
* @function
* @param actual
* @global
* @overwritable
* @param {Object} actual - Actual computed value to test expectations against.
* @return {matchers}
*/
@@ -293,6 +311,7 @@ getJasmineRequireObj().interface = function(jasmine, env) {
* @since 2.0.0
* @function
* @global
* @overwritable
* @param {String} [message] - Reason the spec is pending.
*/
pending: function() {
@@ -305,6 +324,7 @@ getJasmineRequireObj().interface = function(jasmine, env) {
* @since 2.1.0
* @function
* @global
* @overwritable
* @param {String|Error} [error] - Reason for the failure.
*/
fail: function() {
@@ -317,6 +337,7 @@ getJasmineRequireObj().interface = function(jasmine, env) {
* @since 1.3.0
* @function
* @global
* @overwritable
* @param {Object} obj - The object upon which to install the {@link Spy}.
* @param {String} methodName - The name of the method to replace with a {@link Spy}.
* @returns {Spy}
@@ -331,6 +352,7 @@ getJasmineRequireObj().interface = function(jasmine, env) {
* @since 2.6.0
* @function
* @global
* @overwritable
* @param {Object} obj - The object upon which to install the {@link Spy}
* @param {String} propertyName - The name of the property to replace with a {@link Spy}.
* @param {String} [accessType=get] - The access type (get|set) of the property to {@link Spy} on.
@@ -346,6 +368,7 @@ getJasmineRequireObj().interface = function(jasmine, env) {
* @since 3.2.1
* @function
* @global
* @overwritable
* @param {Object} obj - The object upon which to install the {@link Spy}s
* @param {boolean} includeNonEnumerable - Whether or not to add spies to non-enumerable properties
* @returns {Object} the spied object