Back to Jasmine

Jasmine Core 6.0.0-alpha.1 Release Notes

release_notes/6.0.0-alpha.1.md

6.2.04.6 KB
Original Source

Jasmine Core 6.0.0-alpha.1 Release Notes

This is a pre-release, intended to offer a preview of breaking changes and to solicit feedback.

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-alpha.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-alpha.1.

Breaking changes

Changes that affect reporters

  • Irrelevant properties such as status and failedExpectations are omitted from the event passed to suiteStarted.

    This change should be compatible with most existing reporters but could break reporters that manage their internal state in unusual ways. Please open an issue if you find a published reporter package that works with jasmine-core 5.x but not with this release.

Changes that affect browser boot files

  • The createElement and createTextNode options of HtmlReporter are ignored. HtmlReporter now unconditionally uses document.createElement and document.createTextNode.

Changes that affect spec writing

  • HTML reporters cache configuration throughout each run. Configuration changes made while specs are running will not affect reporter behavior.
  • Global error spies always receive a single argument. Previously, the browser error event was passed as the second argument.

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.
    • 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 boot1.js 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 non-Jasmine software that interprets the spec parameter, such as karma-jasmine, you may not be able to adopt HtmlReporterV2 unlesss it's updated.

  • Use globalThis 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.

Deprecations

  • 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 in the past.
  • Deprecated HtmlReporter and HtmlSpecFilter in favor of HtmlReporterV2.

Documentation improvements

  • Improved API reference documentation for APIs that are used from browser boot files.

Internal improvements

  • Removed remaining code that supported suite re-entry.
  • 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.

Supported environments

This version has been tested in the following environments.

EnvironmentSupported versions
Node20, 22, 24
Safari16**, 17**
Chrome141*
Firefox102**, 115**, 128**, 140, 143*
Edge141*

* Evergreen browser. Each version of Jasmine is tested against the latest version available at release time.

** 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