3046 Commits

Author SHA1 Message Date
Steve Gravrock
fb814b5f94 Refactor HtmlReporterV2 test setup 2025-10-09 16:42:42 -07:00
Steve Gravrock
77c3b8b07e Clone HtmlSpecFilter and HtmlReporter in preparation for backward-incompatible changes 2025-10-09 16:42:42 -07:00
Steve Gravrock
bd89ef66c8 Move HtmlReporter components to their own files 2025-10-09 16:42:42 -07:00
Steve Gravrock
01f050eeaa Turn DomContext class back into a function 2025-10-09 16:42:42 -07:00
Steve Gravrock
de44e909f2 Ignore HtmlReporter's createElement and createTextNode options
Injected DOM wrappers were a nice idea in theory but everyone just passes
wrappers around document.createElement/document.createTextNode. That
includes HtmlReporter's unit tests and karma-jasmine-html-reporter, the
only known 5.x-compatible library that constructs an HtmlReporter.
2025-10-09 16:42:42 -07:00
Steve Gravrock
10ad40357a HTML reporter: cache configuration throughout each run 2025-10-09 16:42:42 -07:00
Steve Gravrock
1f521f2a7f Convert what's left of HtmlReporter to an ES6 class 2025-10-09 16:42:42 -07:00
Steve Gravrock
5b3e12e4c5 Decompose HtmlReporter into smaller components 2025-10-09 16:42:37 -07:00
Steve Gravrock
7ba53b25f7 Bump version to 5.12.0 2025-10-05 12:02:56 -07:00
Steve Gravrock
cfd8f11b30 Merge branch '5.99' into 6.0 2025-10-05 10:08:40 -07:00
Steve Gravrock
d95ebf303a Merge branch 'main' into 5.99 2025-10-05 10:04:05 -07:00
Steve Gravrock
dbc1f9244e Revert "Clicking a link in the HTML reporter does exact filtering"
This change broke spec filtering in Karma by changing the format of the
`spec` query parameter. Although karma-jasmine-html-reporter uses
jasmine-core's HtmlSpecFilter, karm-jasmine provides its own spec filter
that interprets the query parameters itself.

This feature may be reintroduced in 6.0 as a breaking change.

This reverts commit 8309416cb2.
2025-10-05 09:59:36 -07:00
Steve Gravrock
489b83c61b Revert "Move knowledge of query parameters out of boot1.js"
This reverts commit 6715f24fd0.
2025-10-05 09:54:25 -07:00
Steve Gravrock
b881b0077d Warn if jasmine-core is loaded as an ES module in browsers 2025-10-05 09:03:27 -07:00
Steve Gravrock
67ef721c85 Fix startup crash in Karma
The previous commit left one code path un-converted to globalThis. That
exposed a bug in Karma: Karma loads jasmine-core via <script type="module">
even though it's not an ES module. In ES modules, the value of `this`
outside of a method is undefined rather than window. The Angular dev tools
try to work around that bug by monkey-patching window to look like GJS's
window object, which worked until the GJS hack was removed in the previous
commit.
2025-10-05 09:00:37 -07:00
Steve Gravrock
c4abf3265d Use globalThis to determine the global object during initialization
This slightly simplifies the init code and hardens Jasmine against broken
bundlers that assume everything can be wrapped in a "use strict" context.

This removes a workaround for incompatible `this` behavior in GJS. GJS was
never a supported envronment, but in any case the change is unlikely to
cause problems since GJS ha supported globalThis since 2020.
2025-10-05 07:23:54 -07:00
Steve Gravrock
68a7cbb991 Adopt strict mode throughout the codebase 2025-10-05 06:53:54 -07:00
Steve Gravrock
73a30ffc3e Made SpyRegistry compatible with strict mode 2025-10-05 06:53:39 -07:00
Steve Gravrock
18491e9b84 Encapsulate suite result 2025-10-05 06:19:16 -07:00
Steve Gravrock
0738ba6462 Omit irrelevant properties from suiteStarted 2025-10-05 06:16:57 -07:00
Steve Gravrock
712f9bac29 Encapsulate spec result 2025-10-05 06:01:27 -07:00
Steve Gravrock
d99bc3ab58 Encapsulate spec status 2025-10-05 06:01:27 -07:00
Steve Gravrock
418393c496 rm more vestiges of suite re-entry support 2025-10-05 06:01:27 -07:00
Steve Gravrock
2a83f5cc30 Don't mutate suite's failedExpectations from env 2025-10-05 06:01:15 -07:00
Steve Gravrock
bca56032e0 Expose browser errors uniformly outside of GlobalErrors 2025-10-04 12:48:14 -07:00
Steve Gravrock
c590095662 Copy 6.0.0-alpha.0 release notes from branch 2025-09-29 19:53:25 -07:00
Steve Gravrock
dbcc1c924a Bump version to 6.0.0-alpha.0 2025-09-29 18:45:30 -07:00
Steve Gravrock
90ee9a0cac Merge branch '5.99' into 6.0 2025-09-29 18:11:46 -07:00
Steve Gravrock
b9f04f8702 Merge branch 'main' into 5.99 2025-09-29 18:11:33 -07:00
Steve Gravrock
e11f320df3 Also require setSpecProperty/setSuiteProperty args to be JSON serializable 2025-09-27 15:40:19 -07:00
Steve Gravrock
c2ce55580c Remove support for excution orders that re-enter suites 2025-09-27 14:41:35 -07:00
Steve Gravrock
4598e4049c Revert accidental change to 3.9 release notes 2025-09-27 13:22:51 -07:00
Steve Gravrock
168ff0a751 Move private APIs to private namespace
Fixes #2078
2025-09-27 13:21:09 -07:00
Steve Gravrock
fbec066837 rm unused deprecatingSpecProxy 2025-09-27 12:58:48 -07:00
Steve Gravrock
0688db88e9 Bump version to 5.11.0 2025-09-26 16:53:15 -07:00
Steve Gravrock
190a13ed96 Prevent mock clock timing fns from being spied on
Fixes #826
2025-09-26 16:14:51 -07:00
Steve Gravrock
979e4a5d0f Fixed naming in SpyRegistry specs 2025-09-25 20:41:19 -07:00
Steve Gravrock
8863643d55 Fixed broken SpyRegistry spec 2025-09-25 20:40:31 -07:00
Steve Gravrock
7214ccd3dc Validate that setSuiteProperty and setSpecProperty args are cloneable 2025-09-21 15:09:42 -07:00
Steve Gravrock
970cbdc69c Omit irrelevant properties from specStarted 2025-09-21 15:09:38 -07:00
Steve Gravrock
4020da25a4 Refactor Suite#addExpectationResult to use named arguments 2025-09-21 09:05:00 -07:00
Steve Gravrock
4a36ece65b Revert "Drop support for Safari 16 and Firefox 102"
This reverts commit e2a7740322.

structuredClone errors in these browsers were a symptom of inavertently
including Error objects in reporter events. In newer browsers,
structuredClone can copy those objects, but it's lossy: if an instance of
an Error subclass is cloned, the result is an instance of Error.

With that fixed, Jasmine is compatible with Safari 16 and FF 102. At least
for now. And keeping them around may provide a way to detect similar bugs.
2025-09-21 08:44:17 -07:00
Steve Gravrock
17c0567bae Don't leak errorWithStack in late async expectation failures 2025-09-21 08:38:46 -07:00
Steve Gravrock
e2a7740322 Drop support for Safari 16 and Firefox 102
Neither of these browsers has sufficient structuredClone support. FF 102
is well past EOL and Safari 16 only runs on past-EOL OS versions.
2025-09-20 17:19:24 -07:00
Steve Gravrock
6e0342fc8e Deep clone reporter events 2025-09-20 16:18:56 -07:00
Steve Gravrock
d333ecb5b1 Removed useless passed property from ThrowUnlessFailure 2025-09-20 16:17:02 -07:00
Steve Gravrock
1e98a4b61b Removed remaining paths that pass expected and actual of expectations to reporters 2025-09-20 16:16:35 -07:00
Steve Gravrock
7aaa16f576 Removed ReportDispatcher support for multiple args and non-object args
All reporter calls take a single argument of object type, and always have.
2025-09-20 15:52:42 -07:00
Steve Gravrock
ee696cbbf6 Depend on the 4.0 branch of jasmine-browser-runner 2025-09-20 10:48:43 -07:00
Steve Gravrock
88289f592e Revert "Don't remove existing unhandled exception and promise rejection handlers in Node"
This reverts commit 6da88ec19eea2780c030dc95fcc55d059fed69e5.

Removing existing handlers turns out to be load-bearing for Jasmine's
parallel mode. ParallelWorker (in the jasmine package) installs a pair
of handlers before booting core so that it can catch late async errors
that happen after one spec file has finished executing and before the
next starts. If those aren't uninstalled, errors that get routed through
jasmine-core's normal error handling mechanism will also be reported
via ParallelWorker's handlers. It might be possible for ParallelWorker
to uninstall and install its handlers at the right time, but it's
likely that there would be gaps in between when core uninstalls its
handlers and when ParallelWorker installs. And in any case, the
old behavior of GlobalErrors was a perfect match for what ParallelWorker
needs, so let's keep it.
2025-09-20 10:48:43 -07:00