Compare commits

...

733 Commits

Author SHA1 Message Date
Warren
dfb2dbba7c Add artist website and portfolio files with LFS
Some checks failed
Test in latest available Safari / build (push) Failing after 6m25s
2026-05-25 13:50:38 +08:00
Warren
60e16943a7 Configure Git LFS for large files 2026-05-25 12:15:55 +08:00
Steve Gravrock
4ddb07ac2d Drop support for Firefox 102, 115, and 128 (old ESRs)
These browsers have bugs that occasionally cause typed array comparisons
to pass when they should fail, or vice versa:

* for...in loops sometimes omit keys, such that two typed arrays with
  different lengths appear to have the same set of keys.
* Typed arrays sometimes have mulitple undefined keys (which is to say that
  the key itself is undefined). Two typed arrays with identical length and
  contents can compare unequal because of the spurious undefined keys.)

Those problems could be avoided by comparing keys 0...length-1 rather than
the actual set of exposed keys, but that would be a pretty nasty breaking
change for anyone whose code tacks extra properties onto typed arrays. So
far these bugs haven't been seen in anything newer than FF 128. Since the
affected browsers are all past end of life, the most sensible thing is to
just stop testing against them.
2026-03-14 09:11:53 -07:00
Steve Gravrock
6c61b11a6e Built distribution 2026-03-12 07:23:19 -07:00
Steve Gravrock
434575f49d Use one declaration per statement
The old style of merging all of a function's variable declarations into
a single statement made some sense back in the days of var, but there's
no reason to keep doing it now that we use const and let.
2026-03-11 06:30:46 -07:00
Steve Gravrock
03ebebf6fb rm unused spec/.eslintrc.js
This file hasn't done anything since the upgrade to eslint 9.
2026-03-07 14:02:56 -08:00
Steve Gravrock
b864eff3c9 Convert CI to matrix configuration 2026-03-03 18:46:43 -08:00
Steve Gravrock
25a91a611c Run non-parallel tests in Node 24 too, not just parallel 2026-03-03 17:55:54 -08:00
Steve Gravrock
46338ad5b4 Test on Windows in CI 2026-03-03 16:53:32 -08:00
Steve Gravrock
fc2de634ab Fix test failure on Windows 2026-02-28 17:52:48 -08:00
Steve Gravrock
6e52b971cd Merge branch 'fix-issue-1781' of github.com:Tyoneb/jasmine
* Adds toBeRejectedWithMatching async matcher
* Merges #2097 from @Tyoneb
* Fixes #1781
2026-02-28 10:33:33 -08:00
Benoit CHOMEL
0a5acd99cb feat: Add new toBeRejectedWithMatching async matcher
Addresses #1781
2026-02-26 00:01:45 +01:00
Steve Gravrock
f7132d98cd Copy 7.0.0-pre.0 release notes from branch 2026-02-22 14:24:50 -08:00
Steve Gravrock
3de4512681 Bump version to 6.1.0
Some checks are pending
Test in latest available Safari / build (push) Waiting to run
2026-02-22 10:10:40 -08:00
Steve Gravrock
4bf333ed38 rm unnecessary and deprecated eslint-env comments 2026-02-21 11:15:57 -08:00
Steve Gravrock
4f5ef7c2d7 Drop support for Safari 16 and 17
Safari 16 and 17 runners are no longer reliably available in CI. Saucelabs
still provides them, but session creation failures have been frequent for
weeks now. When this has happened in the past, it's been a prelude to
Saucelabs dropping the affected Safari versions altogether.

We could live with retrying ~30-50% of test runs in the hope that things
might improve, but it's probably better to just rip the band-aid off.
2026-02-21 11:14:32 -08:00
Steve Gravrock
5de03beea1 Fix test failure in Node 20 and 22 parallel tests 2026-02-07 20:03:59 -08:00
Steve Gravrock
42baa422b3 Formatting 2026-02-07 18:36:36 -08:00
Steve Gravrock
6af5d24b3b Improve formatting of AggregateErrors 2026-02-07 18:22:12 -08:00
Steve Gravrock
b88ce2d49f Improve AggregateError specs
* Assert that the right inner stack traces are in the right places
* Drop the integration tests. All of the AggregateError-specific code
  is in ExceptionFormatter, so the integration tests just duplicate
  existing integration tests and the ExceptionFormatter specs.
2026-02-07 17:41:39 -08:00
Steve Gravrock
c216ae1d13 Merge branch 'puglyfe-aggregate-errors'
* Adds support for AggregateError
* Merges #2093 from @puglyfe
* Fixes #2063
2026-02-07 16:01:06 -08:00
Charley
319776d241 Report the constituent errors of an AggregateError
Fixes #2063
2026-02-07 11:16:57 -08:00
Steve Gravrock
1d0718dc2f Fix MAX_PRETTY_PRINT_CHARS default jsdoc in source code too 2026-01-19 14:58:15 -08:00
Steve Gravrock
929694310e Merge branch 'fixDefaultsJsDoc' of github.com:HolgerJeromin/jasmine
* Merges #2091 from @HolgerJeromin
2026-01-19 08:15:42 -08:00
Steve Gravrock
7379a3a11b Bump version to 6.0.1
Some checks are pending
Test in latest available Safari / build (push) Waiting to run
2026-01-19 07:59:36 -08:00
Holger Jeromin
4db18aafce Fix default MAX_PRETTY_PRINT_CHARS in JsDoc 2026-01-19 13:41:08 +01: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 are pending
Test in latest available Safari / build (push) Waiting to run
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 are pending
Test in latest available Safari / build (push) Waiting to run
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 are pending
Test in latest available Safari / build (push) Waiting to run
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
79405426fa Bump version to 6.0.0-beta.0
Some checks are pending
Test in latest available Safari / build (push) Waiting to run
2025-11-28 11:35:46 -08:00
Steve Gravrock
00b09a9a04 Simplify HtmlReporterV2 initialization and boot1.js 2025-11-28 09:47:31 -08:00
Steve Gravrock
f5e9b61f73 Replace isArray helper with native Array.isArray 2025-11-28 08:09:51 -08:00
Steve Gravrock
4371081763 Deprecate jsApiReporter and remove it from boot1.js
jsApiReporter was initially added as part of the pre-1.0 Ruby based browser
runner. It looks like it was designed to resolve a race condition betweeen
jasmine-core's startup in the browser and the Ruby runner's startup. Modern
runners handle that either by buffering messages in a custom reporter (e.g.
jasmine-browser-runner's BatchReporter) or by calling env.execute() after a
communication channel has been set up (e.g. the old Jasmine ruby gem). In
any other context, a custom reporter is easier to use than jsApiReporter
because it doesn't require polling.

Adding jsApiReporter to the env imposes small but measurable penalties in
time and space, both of which are proportional to the size of the test
suite.

Other than jasmine-py and Testdouble's jasmine-rails gem, neither of which
ever supported jasmine-core 4 or later, I can find scant evidence of
interest and no evidence of usage after about 2012.
2025-11-28 08:08:50 -08:00
Steve Gravrock
9530ff68ab Fix event listener leaks in own specs 2025-11-28 07:13:52 -08:00
Steve Gravrock
51dc79dc22 rm dead code 2025-11-27 08:45:24 -08:00
Steve Gravrock
b559faec2a HtmlReporterV2: show correct progress when running a subset of specs 2025-11-27 07:24:45 -08:00
Steve Gravrock
d7b1456584 Document the set of possible spec statuses 2025-11-27 07:24:44 -08:00
Steve Gravrock
23894c1a0a Detect monkey patching and emit a deprecation warning.
This isn't comprehensive but it should be broad enough to ensure that most
people who would be affected by blocking monkey patching see a warning.
Covers the jasmine namespace as well as classes that are monkey patched by
zone.js.

Replacing globals (describe/it/etc) doesn't trigger a warning because they
belong to the user and are expected to be replaced.
2025-11-27 07:23:57 -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
32168be6c7 Statically expose pretty printer as jasmine.pp
Pretty printing is occasionally useful outside of the places where a
configured pretty printer is injected (matchers and asymmetric equality
testers). Users sometimes use the private basicPrettyPrinter for that.
jasmine.pp is part of the public interface and uses the current runable's
custom object formatters.
2025-11-22 09:46:45 -08:00
Steve Gravrock
78c14f81a8 Copy 6.0.0-alpha.2 release notes from branch 2025-11-15 14:40:39 -08:00
Steve Gravrock
788eba34b6 Bump version to 6.0.0-alpha.2
Some checks are pending
Test in latest available Safari / build (push) Waiting to run
2025-11-15 10:22:27 -08:00
Steve Gravrock
1f31b4b0f6 Increase font size in HTML reporters 2025-11-15 09:06:19 -08:00
Steve Gravrock
00a8a11904 Merge branch 'slow-reporter' into 6.0 2025-11-15 09:01:44 -08:00
Steve Gravrock
3899d83fb6 HtmlReporterV2: show median and mean spec run time 2025-11-15 09:01:06 -08:00
Steve Gravrock
8f13684a01 Add a slowest specs list to HTMLReporterV2 2025-11-15 08:57:25 -08:00
Steve Gravrock
bdf63f2402 Remove code to support browsers that don't have MessageChannel
Jasmine hasn't actually run in any such browsers since 2.x.
2025-11-12 21:59:17 -08:00
Steve Gravrock
9c2ffae2f9 Add experimental safariYieldStrategy: "time" config option
This greatly improves speed, at least in jasmine-core's own tests.
2025-11-12 21:08:59 -08:00
Steve Gravrock
7b2807b321 Convert clearStack from a function to an object 2025-11-11 18:54:25 -08:00
Steve Gravrock
e930622548 Merge branch 'main' into 6.0 2025-11-11 09:14:14 -08:00
Steve Gravrock
56e2832ebe Add manual and cron triggers to Safari build 2025-11-11 09:13:34 -08:00
Steve Gravrock
d31d33aeb3 Introduce a tab bar
This will make it easier to add a third tab to HtmlReporterV2.
2025-11-09 09:58:57 -08:00
Steve Gravrock
e4c69e960e Add 'use strict' to AllOf.js 2025-11-04 05:52:45 -08:00
Steve Gravrock
a8431f33bd Merge branch '5.99' into 6.0 2025-11-03 17:22:11 -08:00
Steve Gravrock
4995c967ac Merge branch 'main' into 5.99 2025-11-03 17:14:24 -08:00
Steve Gravrock
9a9d3994da Add Safari 26 to supported browsers 2025-11-03 07:37:11 -08:00
Steve Gravrock
ff9feb29d3 Configurable spec/suite filename detection
* Adds extraItStackFrames and extraDescribeStackFrames config properties.
* Un-deprecates the filename properties of reporter events.
* Fixes #2065.
2025-11-01 14:17:01 -07:00
Steve Gravrock
fee7e6e64e Merge branch 'jonahd-g-main'
* Adds jasmine.allOf asymmetric equality tester
* Merges #2087 from @jonahd-g
* Fixes #2083
2025-11-01 09:01:53 -07:00
Steve Gravrock
18d4d38655 Fix version number in 5.12.1 release notes 2025-10-29 19:55:00 -07:00
Steve Gravrock
53e9bc68d2 Bump version to 5.12.1 2025-10-29 19:53:34 -07:00
Steve Gravrock
2be50e1b87 Merge branch 'bonkevin-fix-custom-matcher'
* Fixes custom matchers in top-level specs
* Merges #2088 from @bonkevin
2025-10-29 19:44:06 -07:00
bonkevin
27a1257b6d fix: unavailable custom matchers on top-it 2025-10-29 13:04:10 -04:00
Jonah Bron
75658e0566 jasmine.allOf AsymmetricEqualityTester
New asymmetric equality tester that accepts a variable number of arguments, and will pass if all of them evaluate as being equal to the input value.
Includes unit tests
2025-10-27 10:10:16 -07:00
Steve Gravrock
85322d1877 Re-add support for partial spec name filtering
No UI for this but users can construct URLs manually.
Fixes #2085.
2025-10-24 17:26:49 -07:00
Steve Gravrock
6667a42301 Docs: Fix HtmlReporterV2 ctor example 2025-10-22 16:36:58 -07:00
Steve Gravrock
020dffd504 Don't spy on getGlobal 2025-10-19 10:08:05 -07:00
Steve Gravrock
4201fd848f Require spec/suite property keys to be strings, not just anything that's cloneable and serializable
This matches the jsdoc.
2025-10-19 09:15:12 -07:00
Steve Gravrock
9a67c4e24d Copy 6.0.0-alpha.1 release notes from branch 2025-10-18 13:05:29 -07:00
Steve Gravrock
d66d0d9d2e Fixed standalone distribution 2025-10-18 12:31:48 -07:00
Steve Gravrock
f4b9c889b9 Bump version to 6.0.0-alpha.1 2025-10-18 11:58:17 -07:00
Steve Gravrock
388d7fb1a2 Merge branch '5.99' into 6.0 2025-10-18 10:23:37 -07:00
Steve Gravrock
e993a4a363 Merge branch 'main' into 5.99 2025-10-18 10:21:13 -07:00
Steve Gravrock
54ac39a192 Fix position of duration in both HTML reporters 2025-10-18 09:58:55 -07:00
Steve Gravrock
ea882c2f1e HtmlReporterV2: Show a non-color indication of status while running 2025-10-18 09:46:16 -07:00
Steve Gravrock
4cc605756a Extract an OverallStatusBar widget 2025-10-17 07:58:01 -07:00
Steve Gravrock
b6426d2414 Flesh out jasmine-html.js API reference 2025-10-15 21:50:56 -07:00
Steve Gravrock
2352249441 Clean up progress bar CSS 2025-10-15 19:42:46 -07:00
Steve Gravrock
4dfc34a7a0 Make AlertsView#add private 2025-10-15 19:37:18 -07:00
Steve Gravrock
695a805844 Backfill missing HTML reporter tests 2025-10-15 19:32:47 -07:00
Steve Gravrock
10bc655622 HtmlReporterV2: Show details of failures as soon as they occur 2025-10-14 21:49:33 -07:00
Steve Gravrock
4663280528 Move state tracking out of FailuresView 2025-10-14 21:46:07 -07:00
Steve Gravrock
75347d9ba0 Removed slow test for long-removed IE specific code 2025-10-09 16:42:42 -07:00
Steve Gravrock
86387c9068 HtmlReporterV2: replace dots with progress bar 2025-10-09 16:42:42 -07:00
Steve Gravrock
9b3cc08818 Deprecate HtmlReporter and HtmlSpecFilter 2025-10-09 16:42:42 -07:00
Steve Gravrock
0ad54fc6f0 Clicking a link in HtmlReporterV2 does exact filtering 2025-10-09 16:42:42 -07:00
Steve Gravrock
c042665d9c HtmlReporterV2 doesn't need specStarted 2025-10-09 16:42:42 -07:00
Steve Gravrock
a457cf1b81 Simplify boot1.js 2025-10-09 16:42:42 -07:00
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
Steve Gravrock
0462500c31 Drop support for Node 18, to match jasmine-browser-runner
Selenium-webdriver 4.34 and later don't support it.
2025-09-20 10:48:43 -07:00
Steve Gravrock
72ecc70c5d Move jasmine-core.js source from lib to src 2025-09-20 10:48:43 -07:00
Steve Gravrock
f86f8c3331 Remove useless reinitialize option from noGlobals() 2025-09-20 10:48:43 -07:00
Steve Gravrock
70fbdc98b5 Revert to pre-5.0 default of creating a new core instance in each call to Node boot() 2025-09-20 10:48:43 -07:00
Steve Gravrock
4166ea791c Clean up global error listener leaks in Jasmine's own tests 2025-09-20 10:48:43 -07:00
Steve Gravrock
5439c8c9cd Don't remove existing unhandled exception and promise rejection handlers in Node 2025-09-20 10:48:43 -07:00
Steve Gravrock
2c6ce35ccc Pass spec metadata to filters, not internal Spec instance 2025-09-20 10:48:43 -07:00
Steve Gravrock
7c34b43607 Default forbidDuplicateNames to true 2025-09-20 10:48:43 -07:00
Steve Gravrock
3040abe23d Treat {verboseDeprecations: undefined} as a no-op, like other boolean config props 2025-09-20 10:48:43 -07:00
Steve Gravrock
4d3f6b272a Remove expected and actual properties of expectation results 2025-09-20 10:48:43 -07:00
Steve Gravrock
6ab83e25d1 Don't expose Order instances to reporters 2025-09-20 10:48:43 -07:00
Steve Gravrock
27297de3b8 Drop support for the eval form of setTimeout and setInterval in the mock clock 2025-09-20 10:48:43 -07:00
Steve Gravrock
3cbf4dc27b Deprecate access to non-public Spec properties in spec filters 2025-09-20 10:48:08 -07:00
Steve Gravrock
6d77f3e7f0 Deprecate the eval forms of setTimeout and setInterval 2025-09-20 10:48:08 -07:00
Steve Gravrock
124effe04b API reference docs for QueryString 2025-09-17 20:22:47 -07:00
Steve Gravrock
418e9a7728 Convert QueryString to an ES6 class 2025-09-17 18:35:01 -07:00
Steve Gravrock
6715f24fd0 Move knowledge of query parameters out of boot1.js 2025-09-17 18:23:45 -07:00
Steve Gravrock
fa481b2bd1 API reference docs for HTML reporter and spec filters 2025-09-17 07:30:34 -07:00
Steve Gravrock
8309416cb2 Clicking a link in the HTML reporter does exact filtering
This feature requires an update to boot1.js, as shown in this commit.
Users with an older boot1.js will get the older inexact filtering.
2025-09-17 07:30:20 -07:00
Steve Gravrock
4ccc7bf3ac Document the order property of jasmineStarted and jasmineDone 2025-09-15 18:38:09 -07:00
Steve Gravrock
cca6b2aa07 Adopt forbidDuplicateNames: true in jasmine-core's own tests 2025-09-15 18:38:09 -07:00
Steve Gravrock
78940aa0fb Drop support for Safari 15
Safari 15:

* Lacks structuredClone, which is starting to become useful
* Has stack trace quirks that are not well understood, not properly handled
  by Jasmine, and can cause problems in Jasmine's own tests
* Is not widely used
* Does not run on any OS that still receives security updates
2025-09-15 18:37:59 -07:00
Steve Gravrock
3d8396da0a More precisely characterize suite/spec reporting 2025-09-13 10:10:42 -07:00
Steve Gravrock
0bf9aff195 Extract configuration out of Env 2025-09-07 15:53:24 -07:00
Steve Gravrock
55b2e8846f Disambiguate options params in Env 2025-09-06 13:04:32 -07:00
Steve Gravrock
3493519c9f Fixed global error handling when the env is executed repeatedly 2025-09-06 10:32:56 -07:00
Steve Gravrock
62b5698a99 Clean up TreeRunner onComplete callback 2025-09-06 09:42:39 -07:00
Steve Gravrock
98849882a2 rm TODO comment about integrating detectLateRejectionHandling with clearStack
In theory, resetting clearStack's inline call count every time late
rejection handling does a setTimeout should reduce the performance penalty
in some environments.  In practice, it doesn't:

* In Chrome and FF, late rejection handling has no measurable penalty.
* In Safari, resetting the inline call count actually slows things down
  considerably(!).
* In Node, clearStack doesn't use setTimeout so there is no benefit.
2025-09-06 08:32:37 -07:00
Steve Gravrock
6665c4e123 Don't remove before and after fns from the top suite 2025-09-02 10:23:44 -07:00
Steve Gravrock
3698f6fb5d Support detectLateRejectionHandling in beforeAll and afterAll 2025-09-02 09:58:46 -07:00
Steve Gravrock
60f34ec087 Unify top suite and regular suite execution 2025-09-02 08:05:30 -07:00
Steve Gravrock
91bd3f8201 Optionally test in a subset of browsers locally
When run with --not-actually-all, scripts/run-all-browsers skips all
but the oldest and newest supported Firefox and Safari versions. This
provides a faster but still quite reliable mergeability check.

CI still tests against all supported browsers.
2025-09-01 08:58:32 -07:00
Steve Gravrock
ca4fbcbccb Clarify what's currently treated as private vs internal in Suite and Spec 2025-09-01 08:58:32 -07:00
Steve Gravrock
e1532be726 Convert Suite and SuiteMetadata to ES6 classes 2025-09-01 08:58:32 -07:00
Steve Gravrock
54465f6f6a Convert Spec to an es6 class 2025-09-01 08:58:32 -07:00
Steve Gravrock
fa9939ae94 Improve description of detectLateRejectionHandling feature in release notes 2025-08-30 14:00:00 -07:00
Steve Gravrock
7978ad9889 Fix fn names in release notes 2025-08-30 13:38:28 -07:00
Steve Gravrock
af4662ad31 Bump version to 5.10.0 2025-08-30 13:36:12 -07:00
Steve Gravrock
15c38c7728 Add Firefox 140 (current ESR) to supported browsers and demote 128 to best-effort 2025-08-30 13:31:54 -07:00
Steve Gravrock
b597975c7e Fix and enable pending async expectation message spec 2025-08-30 13:02:08 -07:00
Steve Gravrock
09ce3a30b6 Pend environment-specific specs rather than passing 2025-08-30 12:58:04 -07:00
Steve Gravrock
3bcbc2e3af Tweak spec duration margin 2025-08-30 12:37:15 -07:00
Steve Gravrock
fbaba902dc Merge branch 'bonkevin-html-reporter-with-duration'
* Merges #2073 from @bonkevin
* Adds spec duration to HTML reporter
2025-08-30 12:35:54 -07:00
Steve Gravrock
bf2e8e759e Merge branch 'bonkevin-spec-suite-properties-accessors'
* Merges #2072 from @bonkevin
* Adds Env#getSpecProperty
2025-08-30 12:31:40 -07:00
Steve Gravrock
50e566bd67 Move beforeAll failure reporting into TreeRunner 2025-08-30 07:42:29 -07:00
Steve Gravrock
4b7d5e3623 Update and move remaining disabled Runner specs 2025-08-30 07:21:29 -07:00
Steve Gravrock
6449832e7e rm redundant and long-disabled test for toEqual with DOM nodes 2025-08-29 06:57:32 -07:00
Kevin Bon
c6266b24b7 add test 2025-08-27 10:10:45 -04:00
bonkevin
f16b81d4ef feat: html-reporter with spec duration 2025-08-27 09:58:11 -04:00
kbon
7feec406d9 set the right spec property key 2025-08-25 23:12:29 -04:00
kbon
f822ffea21 feat(getSpecProperty) get a user-defined property 2025-08-25 23:00:06 -04:00
Steve Gravrock
db65c3b131 Fold TreeRunner#runQueueWithSkipPolicy into caller 2025-08-25 18:43:54 -07:00
Steve Gravrock
fd37a7eac0 Move/update/remove obsolste disabled TreeProcessor specs 2025-08-25 18:37:31 -07:00
Steve Gravrock
12219e80c1 Move spec execution from Spec to TreeRunner 2025-08-24 14:05:22 -07:00
Steve Gravrock
a980ae6bf2 Extract spec state management out of Spec#execute 2025-08-24 14:05:22 -07:00
Steve Gravrock
56ac8f5505 Refactor TreeRunner specs 2025-08-24 14:05:13 -07:00
Steve Gravrock
3780fe0b35 Convert some TreeRunner internals to promises 2025-08-24 14:04:47 -07:00
Steve Gravrock
164a393932 Move spec begin and end handling from Env/SuiteBuilder to TreeRunner 2025-08-23 09:03:57 -07:00
Steve Gravrock
759a867094 Backfill unit tests for spec autoCleanClosures 2025-08-23 09:03:57 -07:00
Steve Gravrock
f94d0ceda9 Validate queueableFns 2025-08-23 09:03:38 -07:00
Steve Gravrock
8d99f27be8 Throw an Error rather than a string when createSpyObj is called incorectly 2025-08-23 08:19:11 -07:00
Steve Gravrock
63774597f0 Extract tree running out into a separate class 2025-08-18 16:50:04 -07:00
Steve Gravrock
a3e1abfa12 Split the resulting execution tree out from TreeProcessor 2025-08-17 11:44:52 -07:00
Steve Gravrock
b89a870a59 Test TreeProcessor's public interface, not internal state 2025-08-17 11:44:37 -07:00
Steve Gravrock
ea3fc88803 Remove mutual recursion between Runner and TreeProcessor 2025-08-17 11:44:36 -07:00
Steve Gravrock
d5884e33c6 Move suite execution and spec queueRunner building from TreeProcesor to Runner
This:
* Sets the stage for getting suite and spec execution in one place
* Greatly simplifies the interaction between Runner and TreeProcessor
* Focuses TreeProcessor more on building execution trees
2025-08-17 11:43:00 -07:00
Steve Gravrock
138bf9be4b Focused integration tests for Runner and TreeProcessor
These are mostly adaptations of the execution tests from TreeProcessorSpec.js.
They are meant to support refactoring of the interface and responsibility
division between Runner and TreeProcessor. All these scenarios are probably
covered by nearly-end-to-end integration tests, but those are more difficult
to debug.
2025-08-17 09:23:29 -07:00
Steve Gravrock
98d5284c19 Check for and silence suite reentry warnings in Jasmine's own tests 2025-08-15 06:58:08 -07:00
Steve Gravrock
2299c85751 Deprecate spec/suite orders that interleave suites 2025-08-13 19:02:36 -07:00
Steve Gravrock
8e3ec25f6d Move invalid order exception throw into TreeProcessor 2025-08-13 18:30:51 -07:00
Steve Gravrock
b009cd2922 Convert TreeProcessor to a class 2025-08-12 18:23:57 -07:00
Steve Gravrock
8eee6ebb91 Runner: naming improvements, use private members 2025-08-11 23:22:07 -07:00
Steve Gravrock
c15a1aaa6d Rename queueRunnerFactory to runQueue throughout 2025-08-11 23:05:56 -07:00
Steve Gravrock
5b06531cac Prevent GloablErrors from being monkey patched
All current shipped versions of zone.js contain a monkey patch that fails
to pass constructor arguments on to GlobalErrors. That would crash Jasmine
if it was applied early enough to have any effect.

See <https://github.com/angular/angular/issues/63072>.
2025-08-11 18:08:47 -07:00
Steve Gravrock
42cca93926 Minor jsdoc cleanup 2025-08-09 08:35:49 -07:00
Steve Gravrock
395ef85954 Optionally detect late promise rejections and don't report them as errors 2025-08-09 08:35:08 -07:00
Steve Gravrock
5e88fde655 Backfill some unit tests for Runner's interaction with TreeProcessor 2025-07-29 09:59:45 -07:00
Steve Gravrock
bb777e93e5 Bump version to 5.9.0 2025-07-19 08:27:17 -07:00
Steve Gravrock
9d3fb167a2 Document that the filename property of suite and spec results is deprecated
See <https://github.com/jasmine/jasmine/issues/2065>.
2025-07-19 06:54:54 -07:00
Steve Gravrock
3176eaf1d8 Merge branch 'idConflict' of https://github.com/atscott/jasmine
* Avoid generating timers with IDs that conflict with native
* Fixes #2068
* Merges #2069 from @atscott
2025-07-15 16:50:57 -07:00
Andrew Scott
d31a431d1f fix(clock): Avoid generating timers with IDs that conflict with native
This commit attempts to ensure that the timers created by jasmine mock
clock do not conflict with the native timers. This also retains
pre-existing behavior whereby a native scheduled function cannot be
cleared if it was created prior to the mock clock being installed
(unless the mock clock is uninstalled first).

Prior to this commit, attempting to clear a native timer would result in
clearing a mocked scheduled function instead, in some scenarios where
the IDs conflicted.

fixes #2068
2025-07-14 16:55:05 -07:00
Steve Gravrock
84f78c1435 Split GlobalErrors into portable and platform-specific parts 2025-07-12 13:59:19 -07:00
Steve Gravrock
ff476b1982 Unify error dispatching between browser and node 2025-07-12 13:56:58 -07:00
Steve Gravrock
d53d2ff3eb Convert GlobalErrors to an ES6 class 2025-07-12 13:56:50 -07:00
Steve Gravrock
adfbd00c75 Refactor mocking in GlobalErrorsSpec 2025-07-12 13:56:48 -07:00
Steve Gravrock
495e5fcd50 Backfill integration tests for unhandled promise rejections 2025-07-11 21:36:30 -07:00
Steve Gravrock
bc2aa7be25 Start breaking up integration/EnvSpec.js 2025-07-11 07:39:39 -07:00
Steve Gravrock
af04599bb5 Relaxed timeout on flaky test 2025-07-09 06:56:08 -07:00
Steve Gravrock
21db6ec0e3 Removed unnecessary errorWithStack helper 2025-06-22 12:49:26 -07:00
Steve Gravrock
2d07b3e6d7 Removed protections against user code redefining undefined
Jasmine hasn't even run on platforms that allowed redefining undefined
since 2.x.
2025-06-22 12:23:18 -07:00
Steve Gravrock
6891789ed2 Don't test on Node versions before 18.20.5
18.20.5 is the oldest version supported by current selenium-webdriver.
Also, many dev dependencies require at least 18.18.0.
2025-06-14 10:22:03 -07:00
Steve Gravrock
7a3d3c9360 Removed shelljs dev dependency 2025-06-14 09:05:12 -07:00
Steve Gravrock
1b2922e008 Don't hardcode temp dir in buildStandaloneDist 2025-06-14 09:05:12 -07:00
Steve Gravrock
bd8d23f2a7 Removed rimraf dev dependency 2025-06-14 09:05:06 -07:00
Steve Gravrock
de26763868 CI: remove special case for Chrome 2025-06-09 15:05:50 -07:00
Steve Gravrock
f4be08b657 Bump version to 5.8.0 2025-06-06 17:34:09 -07:00
Steve Gravrock
50ef882a1a Merge branch 'gh1886-spy-args-deep-clone' of https://github.com/evanwalsh/jasmine
Merges #2062 from @evanwaslh
Fixes #1886
2025-06-05 06:54:37 -07:00
Steve Gravrock
c1cd5c6291 Use custom object formatters in spy strategy mismatch errors 2025-06-05 05:46:29 -07:00
Steve Gravrock
63ed2b3948 Include function names in pretty printer output
This helps make matcher errors and spy strategy mismatch errors easier
to understand in cases where the difference involves expecting one
function but getting a different one.
2025-06-04 18:37:44 -07:00
Steve Gravrock
0183acc682 Fix diff building when only one side has a custom object formatter
Fixes #2061
2025-06-04 18:04:40 -07:00
Steve Gravrock
e15819c0dd Test aginast Node 24 2025-05-27 17:32:39 -07:00
Evan Walsh
f694194b2b Allow passing a function to saveArgumentsByValue to customize how arguments are saved
For instance, pass `structuredClone` to do a deep clone.

Fixes https://github.com/jasmine/jasmine/issues/1886
2025-05-27 15:43:21 -04:00
Steve Gravrock
94c00886a6 Merge branch 'setimmedate' of https://github.com/atscott/jasmine
Merges #2058 from @atscott
2025-05-03 10:00:41 -07:00
Steve Gravrock
f5915d7963 Bump version to 5.7.1 2025-05-01 19:31:30 -07:00
Steve Gravrock
15587f3ce3 Merge branch 'autotickuninstall' of https://github.com/atscott/jasmine
Merges #2057 from @atscott
2025-05-01 16:46:30 -07:00
Andrew Scott
3ecddc2555 fixup! fix(Clock): Ensure that uninstalling the clock also stops auto tick 2025-05-01 10:25:24 -07:00
Andrew Scott
6a7c0e6368 perf(clock): use setImmediate for autoTick macrotask in Node
When called within an I/O cycle, `setImmediate` is generally faster because it
is designed to execute immediately after the current I/O event completes,
whereas `setTimeout(0)` gets placed in the timers queue and might be subject to delays.

> The main advantage to using setImmediate() over setTimeout() is setImmediate()
> will always be executed before any timers if scheduled within an I/O cycle,
> independently of how many timers are present.

* https://nodejs.org/en/learn/asynchronous-work/event-loop-timers-and-nexttick#setimmediate-vs-settimeout
* https://nodejs.org/en/learn/asynchronous-work/event-loop-timers-and-nexttick#poll
* https://nodejs.org/en/learn/asynchronous-work/understanding-setimmediate
2025-04-30 14:10:39 -07:00
Andrew Scott
84daa0f5dc fix(Clock): Ensure that uninstalling the clock also stops auto tick
The autotick feature mistakenly does not account for the clock being a
singleton and the re-installation of the clock causes the auto ticking
exit conditions to become true again, before it has a chance to break.
2025-04-30 13:38:10 -07:00
Steve Gravrock
c6b3e947e9 Fixed errors in 5.7.0 release notes 2025-04-29 07:28:36 -07:00
Steve Gravrock
0e604de0db Bump version to 5.7.0 2025-04-26 09:29:07 -07:00
Steve Gravrock
e7ca9c5765 Built distribution 2025-04-26 09:28:21 -07:00
Steve Gravrock
cbff6f95cb Fixed autoTick jsdoc 2025-04-26 08:27:12 -07:00
Steve Gravrock
361640f52e Document that SpecResult#filename and SuiteResult#filename are wrong in some common scenarios
See:

* https://github.com/jasmine/jasmine/issues/2016
* https://github.com/jasmine/jasmine/issues/1884
2025-04-26 07:38:28 -07:00
Steve Gravrock
e5d46e8624 Expose spec path as an array of names
This is in addition to the existing concatenated name. It's meant to
support tools like IDE integrations that want to be able to filter a
run to an exact set of suites/specs.
2025-04-12 09:49:35 -07:00
Steve Gravrock
8f6b3c49cc Removed flaky test
It doesn't look like there's a reliable way to test setTimeout throttling
prevention. The underlying behavior is too nondeterministic. This test
failed at a significant rate in browsers where throttling prevention worked,
simply due to setTimeout taking longer than expected (e.g. 130ms for the
entire test vs an expected <= 5oms). When run in Safari, where setTimeout
throttling prevention doesn't work, it would incorrectly pass if run early
enough in the test order. This is presumably because setTimeout throttling
is influenced by the setTimeout calls made by Jasmine itself prior to
running the test.
2025-04-12 08:28:15 -07:00
Steve Gravrock
df6ab05280 Merge pull request #2056 from jasmine/fix-readme-image
Update README header image
2025-04-11 12:11:06 -07:00
Steve Gravrock
9ea027dbff Update README header image
* Work around GitHub's broken rendering of rawgithub.com images
* Add alt text
* Remove unnecessary docs link
2025-04-11 12:10:25 -07:00
Steve Gravrock
7cc7da4abc Merge branch 'degrunt' 2025-04-10 18:36:21 -07:00
Steve Gravrock
8be98e73ca Use published css-url-embed 2025-04-10 18:27:55 -07:00
Steve Gravrock
52aaf63d22 Create the dist dir if it doesn't already exist 2025-04-10 18:27:55 -07:00
Steve Gravrock
a09fdd3284 Removed remaining use of Grunt 2025-04-09 09:11:19 -07:00
Steve Gravrock
89f3e9449d Use ejs to build SpecRunner.html 2025-04-08 21:53:05 -07:00
Steve Gravrock
ba033c520d Use sass directly rather than grunt-sass 2025-04-08 21:27:43 -07:00
Steve Gravrock
fc935e89c6 Removed grunt-contrib-concat 2025-04-08 21:08:45 -07:00
Steve Gravrock
4bd2feda7d Use archiver directly rather than grunt-contrib-compress
Removes two old copies of glob and is another step towards removing Grunt.
2025-04-08 18:48:58 -07:00
Steve Gravrock
bcf699f145 Switch from grunt-css-url-embed to css-url-embed
This eliminates some rickety indirect dependencies and is a big step
towards removing Grunt.
2025-04-08 18:00:55 -07:00
Steve Gravrock
d4f29491c9 Removed old eslint config file 2025-04-08 07:46:50 -07:00
Steve Gravrock
5b1c932f89 Built distribution 2025-04-07 22:07:52 -07:00
Steve Gravrock
7a8d6e44e3 Fixed sass deprecation warning 2025-04-07 21:59:56 -07:00
Steve Gravrock
dac349397e Updated grunt-sass 2025-04-07 21:59:14 -07:00
Steve Gravrock
5ff7e7f9a1 Updated to eslint 9
This isn't officially compatible with the oldest version of Node that
Jasmine supports, but it works. If it stops working, we can always disable
linting in CI builds on older Node versions.
2025-04-07 21:39:58 -07:00
Steve Gravrock
7b2ab822c6 Removed mostly-unmaintained dev dependency 'temp'
temp has seen some recent maintainer activity but there haven't been
any commits since 2021 and PRs have gone un-addressed for years. It's
one of the dev dependencies that depends on very old versions of rimraf.
2025-04-07 21:35:36 -07:00
Steve Gravrock
033260300a Upgrade shelljs 2025-04-07 21:35:36 -07:00
Steve Gravrock
cb66b54f8b Upgraded jsdom 2025-04-07 21:35:36 -07:00
Steve Gravrock
f4a8102a80 Merge pull request #2055 from atscott/throttleTest
Fix throttling test unit conversion bug and disable test in Node
2025-04-07 21:31:54 -07:00
Andrew Scott
8f539f17b2 refactor(Clock): Fix throttling test unit conversion bug
* fixes the throttling timeout test which incorrectly converted
from milliseconds to seconds before making an assertion expecting
milliseconds.
* reduces number of timeouts from 2000 to 100, which is still more than enough
to observe throttling (or lackthereof).
* Omits Node from the test since it does not throttle timeouts
2025-04-07 08:37:26 -07:00
Steve Gravrock
e5c543a0a1 Updated bug report template
* Don't separately ask for code and steps to reproduce. They're usually
  the same.
* Require steps to reproduce, don't just recommend them
2025-03-21 10:46:45 -07:00
Steve Gravrock
7d697faf95 Merge branch 'atscott-autoTick'
* Merges #2042 from @atscott
* Fixes #1932
* Fixes #1725
2025-03-21 09:21:14 -07:00
Steve Gravrock
6f23151a5e Hardened stop-sauce-connect 2025-03-17 17:33:34 -07:00
Steve Gravrock
e53c7ed8d1 Update to Sauce Connect 5 2025-03-16 14:34:36 -07:00
Andrew Scott
dcd44a0edf feat(Clock): Add ability to automatically tick the clock asynchronously
Testing with mock clocks can often turn into a real struggle when
dealing with situations where some work in the test is truly async and
other work is captured by the mock clock. This can happen for many
reasons, but as one example:

An asynchonrous change from a task in the mocked clock may change DOM where
a resize observer then gets triggered. This browser API is truly asynchronous
and would require the user to wait real time for it to fire. If there is
follow-up work after the resize observer fires, it may be captured by the mock
clock again. This would require the tester to write something like the
following:

```
// flush the timer
jasmine.clock().tick();
// wait for resize observer
await new Promise(resolve => setTimeout(resolve));
// flush follow-up work from the resize observer callback
jasmine.clock().tick();
```

When using mock clocks, testers are always forced to write tests with intimate
knowledge of when the mock clock needs to be ticked. Oftentimes, the
purpose of using a mock clock is to speed up the execution time of the
test when there are timeouts involved. It is not often a goal to test
the exact timeout values. This can cause tests to be riddled with
`tick`. It ideal for test code to be written in a way
that is independent of whether a mock clock is installed. For example:

```
document.getElementById('submit');
// https://testing-library.com/docs/dom-testing-library/api-async/#waitfor
await waitFor(() => expect(mockAPI).toHaveBeenCalledTimes(1))
```

When mock clocks are involved, the above may not be possible if there is
some delay involved between the click and the request to the API.
Instead, developers would need to manually tick the clock beyond the
delay to trigger the API call.

This commit attempts to resolve these issues by adding a feature to the
clock which allows it to advance on its own with the passage of time,
just as clocks do without mocks installed. It also allows for some
breathing time so any unmocked micro and macrotasks are given space to
execute as well.

This feature would also address both #1725 and #1932. `asyncTick` can be
accomplished by enabling the auto tick feature and then waiting for a
promise with a timout to be resolved
(`await new Promise(resolve => setTimeout(resolve, 20))`) where
`setTimeout` is captured by the mock clock and flushed while the code is
waiting for the promise to resolve.

resolves #1725
resolves #1932

All credit goes to @stephenfarrar for this.
2025-03-10 15:31:32 -07:00
Steve Gravrock
f0a5ea9d0f Updated docs for expected and actual properties of expectation results 2025-02-17 12:07:32 -08:00
Steve Gravrock
491b513aa3 Debug logs for rare TypedArray comparison failures in Firefox 2025-02-16 20:30:47 -08:00
Steve Gravrock
d5872bba66 Fixed Safari footnotes in release notes 2025-02-08 11:13:28 -08:00
Steve Gravrock
c4f4edda1b Bump version to 5.6.0 2025-02-08 11:10:06 -08:00
Steve Gravrock
cf057b6631 Fixed parse error from jsdoc
"arguments" isn't a legal argument name in strict mode JS. The JS
runtimes that Jasmine runs in allow it, but jsdoc doesn't.
2025-02-08 10:25:41 -08:00
Steve Gravrock
2a7a157713 toHaveNoOtherSpyInteractions message tweaks 2025-01-20 11:31:47 -08:00
Steve Gravrock
7463fe511b Match messages exactly in toHaveNoOtherSpyInteractions specs 2025-01-20 11:31:18 -08:00
Steve Gravrock
1b724daa10 Merge branch 'Eradev-issue-1991'
* Merges #2051 from @Eradev
* Fixes #1991
2025-01-20 11:31:06 -08:00
Eradev
888d3b6250 Modified error message 2025-01-18 17:55:00 -05:00
Eradev
289afbf0a6 Remove jsdoc from unverifiedCount 2025-01-18 17:25:07 -05:00
Steve Gravrock
9b89bee4f5 Demote Safari to best-effort support 2025-01-18 11:31:17 -08:00
Eradev
3f8f488a58 Fix broken tests 2025-01-11 12:41:28 -05:00
Steve Gravrock
592d47e971 Update copyright date 2025-01-11 08:33:37 -08:00
Eradev
4732012f1c toHaveNoOtherSpyInteractions implementation 2025-01-10 21:05:12 -05:00
Steve Gravrock
7683325d68 Improved specs for async matcher error messages 2024-12-31 10:10:40 -08:00
Steve Gravrock
03d665e243 Merge branch 'improve_toBeRejectedWithError' of https://github.com/andiz2/jasmine 2024-12-31 10:07:53 -08:00
Andrei D
a1591da25d improved error msg on toBeRehectedWithError and all other built-in async matchers 2024-12-22 17:43:47 +02:00
Steve Gravrock
1f1e1209d2 Merge branch 'add_toBeNullish' of https://github.com/MattMcCherry/jasmine
* Merges #2045 from @MattMcCherry
2024-12-12 17:30:55 -08:00
Steve Gravrock
a389905a38 Merge branch 'feature/matcher-toHaveClasses' of https://github.com/aYorky/jasmine
* Merges #2046 from @aYorky
2024-12-11 19:19:58 -08:00
Matt McCherry
36dd6b07d1 add integration test for a falsy value 2024-12-10 11:39:44 +00:00
Matt McCherry
2f3689713b add tests for falsy values 2024-12-10 11:31:16 +00:00
Alex Yorkovich
819fab7b58 simplified match condition 2024-12-07 13:14:25 -06:00
Steve Gravrock
e5ca1f37f1 Use discussions for support requests, not issues 2024-12-07 09:32:57 -08:00
Alex Yorkovich
c3650ea7c7 updated release number 2024-12-04 12:34:36 -06:00
Alex Yorkovich
1805337424 Added new toHaveClasses matcher; tests included 2024-12-04 12:20:15 -06:00
Matt McCherry
27bb6ebac1 reset jasmine.js 2024-12-02 10:34:55 +00:00
Matt McCherry
580323c221 run prettier and fix tests 2024-12-02 10:34:55 +00:00
Matt McCherry
d9286c549f add integration test for toBeNullish 2024-12-02 10:34:55 +00:00
Matt McCherry
26dfa6d257 Add .toBeNullish matcher 2024-12-02 10:34:49 +00:00
Steve Gravrock
483d4ab3c3 Bump version to 5.5.0 2024-11-23 10:58:56 -08:00
Steve Gravrock
663dfe5932 Updated release instructions 2024-11-23 10:42:20 -08:00
Steve Gravrock
ce9c752899 Added debug logging to flaky test 2024-11-12 20:25:20 -08:00
Steve Gravrock
d5e7bc9fd6 Optionally enforce uniqueness of spec and suite names
This is off by default for backwards compatibility but can be enabled
by setting the forbidDuplicateNames env config property to true.

Fixes #1633.
2024-11-10 09:54:51 -08:00
Steve Gravrock
744e765d6f Update copyright date 2024-11-09 13:37:46 -08:00
Steve Gravrock
29551ba4f3 Prettier 2024-11-09 13:17:32 -08:00
Steve Gravrock
bd9a3b2305 Include property value mismatches in diffs even when there are missing or extra properties 2024-11-09 11:22:27 -08:00
Steve Gravrock
c8c3325b56 Bump version to 5.4.0 2024-10-12 10:31:35 -07:00
Steve Gravrock
84c7e2b21b Fixed de-duplication of exception messages containing blank lines on Node and Chrome
This is particularly helpful when reporting testing-library errors, which
have messages that contain blank lines and can be hundreds or even thousands
of lines long.
2024-10-07 20:04:07 -07:00
Steve Gravrock
dda25bb29e Removed references to PhantomJS from StackTraceSpec.js 2024-10-07 19:55:34 -07:00
Steve Gravrock
9ccf2ef96b Also deprecate the expected and actual properties of ThrowUnlessFailure 2024-10-05 13:55:49 -07:00
Steve Gravrock
c6fa55bfc8 Clarify support status of old Firefox ESRs 2024-10-05 13:46:49 -07:00
Steve Gravrock
06bcf1c2e1 Fixed broken docs link 2024-10-05 13:38:52 -07:00
Steve Gravrock
40f402d117 Deprecate the expected and actual properties of expectation results 2024-10-04 07:54:20 -07:00
Steve Gravrock
71f6a95ce5 Added Firefox 128 (current ESR) to supported browsers 2024-09-24 06:54:36 -07:00
Steve Gravrock
5cd7d47f72 Bump version to 5.3.0 2024-09-07 13:18:21 -07:00
Steve Gravrock
d0fe5c4712 Require curly braces around loop and conditonal bodies 2024-09-02 11:30:36 -07:00
Steve Gravrock
f602c4911c Merge branch 'dave-unclamp-safari' of https://github.com/dcsaszar/jasmine
* Significantly improves performance in Safari
* Merges #2040 from @dcsaszar
* Fixes #2008
2024-09-02 11:22:56 -07:00
Steve Gravrock
7aaf7eaf30 API reference for reporter capabilities 2024-09-02 10:53:56 -07:00
David Császár
35f16e8125 Add test for unclamping setTimeout in Safari 2024-09-01 10:22:16 +02:00
David Császár
acc777c267 Unclamp setTimeout in Safari
Fixes #2008

wrapping setTimeout in postMessage is a trade-off between
* slowdown due to postMessage (slow on Safari)
* speedup due to no setTimeout clamping (can be severe on Safari)
2024-09-01 10:21:57 +02:00
David Császár
1c74356691 Add unclampedSetTimeout helper 2024-09-01 09:54:55 +02:00
David Császár
bbebea0fa5 Refactor: extract postMessage 2024-09-01 09:31:52 +02:00
Steve Gravrock
66eb27b0af Throw if spying has no effect
This provides a useful diagnostic in cases where assigning to a property
is a no-op, like localStorage in Firefox and Safari 17.

See #2036 and #2007.
2024-08-17 09:07:18 -07:00
Steve Gravrock
7a63c06a65 Merge branch 'webkit-performance' of https://github.com/m-akinc/jasmine
* Merges #2034 from @m-akinc
2024-08-10 07:26:00 -07:00
Mert Akinc
554dfd4923 Update comments as requested 2024-08-05 12:27:11 -05:00
Mert Akinc
36a6e2aa1d Merge branch 'main' into webkit-performance 2024-08-05 12:19:53 -05:00
Steve Gravrock
3c4b73f136 Fixed globbing in own test suite when running on Windows outside of c:\Users
The previous code used path.join() to construct glob input. That should't
work, but it did as long as the working directory was under c:\Users.
2024-08-03 18:06:20 -07:00
Mert Akinc
bc3ed74336 Formatting fix 2024-07-26 17:54:04 -05:00
Mert Akinc
97b6f33cc2 Add test, update rexex pattern and constant name 2024-07-26 17:45:23 -05:00
Mert Akinc
a9889ddb31 Improve performance on Playwright Windows WebKit 2024-07-25 09:54:32 -05:00
Steve Gravrock
cd1b7ce9c7 Bump version to 5.2.0 2024-07-20 08:44:53 -07:00
Steve Gravrock
3653d6e0ef Moved eslint and prettier configs out of package.json 2024-07-18 07:17:31 -07:00
Steve Gravrock
c3387f8dbf Merge branch 'stephanreiter-better-toHaveSize'
* Merges #2033 from @stephanreiter
2024-07-13 14:02:15 -07:00
Steve Gravrock
3d54184c7f Docs: Improved discoverability of asymmetric equality testers 2024-07-03 10:17:57 -07:00
Stephan Ferlin-Reiter
6f23e706d7 Improve the error message of the toHaveSize matcher.
We include the size of the thing that didn't meet the size expectation.
2024-07-02 20:28:16 +00:00
Steve Gravrock
cc69edf92c Fixed stack trace filtering in FF when the developer tools are open 2024-06-22 11:49:49 -07:00
Steve Gravrock
ba7560f65e HTML reporter: show debug logs with white-space: pre 2024-06-22 11:44:11 -07:00
Steve Gravrock
c3960c4a96 Test against Node 22 2024-06-18 18:13:51 -07:00
Steve Gravrock
5c21f94bb1 4.6.1 release notes 2024-05-25 10:24:11 -07:00
Steve Gravrock
8cd7c94490 Added a jsdoc example for withContext()
Fixes jasmine/jasmine.github.io#166
2024-04-16 16:22:25 -07:00
Steve Gravrock
6a6fa7b29a Tests for existing handling of non-Error global errors in Node 2024-03-22 09:15:22 -07:00
Steve Gravrock
4984548cab Clarify argument to spyOnGlobalErrorsAsync's spy 2024-03-22 08:53:19 -07:00
Steve Gravrock
6941bde7e2 Revert "Deprecate the suppressLoadErrors option"
jasmine-npm still needs this to enable the default behavior of crashing
with a stack trace on load errors.

This reverts commit 99e350ac85.
2024-03-21 09:34:26 -07:00
Steve Gravrock
1504f25ced Report the message when a browser error event with a message but no error occurs 2024-03-21 09:15:43 -07:00
Steve Gravrock
99e350ac85 Deprecate the suppressLoadErrors option
This was intended as a 3.0 migration aid for browser users who had
dependencies that triggered errors at load time. However, it was never
documented and never supported by jasmine-brower-runner, karma, or any
other commonly used tool for runing Jasmine in the browser. There is
no evidence of it actually being used. It is, however, starting to
show up in machine-generated "tutorials".
2024-03-04 19:35:31 -08:00
Steve Gravrock
1624b07589 Clarify spyOnGlobalErrorsAsync API docs 2024-03-04 19:35:24 -08:00
Steve Gravrock
d06dce4614 Bump version to 5.1.2 2024-02-08 17:22:46 -08:00
Steve Gravrock
03098e81f8 Fixed throwUnlessAsync
Fixes #2026
2024-02-05 18:49:19 -08:00
Steve Gravrock
726c152f6e Added Safari 17 to supported browsers 2024-02-05 18:44:11 -08:00
Steve Gravrock
409d2e29e5 Fixed formatting of copyright notice in README 2023-10-14 17:38:30 -07:00
Steve Gravrock
01e2bd5050 Updated copyright notices
The Pivotal copyright notice needs to be retained. That's the right
thing to do and the MIT license requires it. However, using it by itself
becomes more obviously incorrect with each passing year since Pivotal
ceased to exist. Moreover, Pivotal hasn't actually been the sole
copyright owner since the first external contribution was merged.
Contributors were not asked to sign a copyright assignment, so they
retain copyright to their contributions.

"Copyright (c) 2008-2019 Pivotal Labs" complies with the terms of the
license and acknowledges Pivotal's outsized role in developing Jasmine.
"Copyright (c) 2008-$YEAR The Jasmine developers" acknowledges all
authors and will remain correct in the future.
2023-10-14 08:55:48 -07:00
Steve Gravrock
96033e38ea Merge branch 'main' of https://github.com/jd-apprentice/jasmine
* Merges #2017 from @jd-apprentice
2023-10-07 10:34:06 -07:00
Steve Gravrock
ed75290ef7 Removed badges from README
The CI status badge mostly just shows whether Saucelabas was flaky
last night. Code Triage was a nice idea but it's attracted at most
one new contributor over 5.5 years.
2023-09-30 10:22:37 -07:00
Steve Gravrock
a14dbf012a Fix Chrome on CI 2023-09-30 08:33:27 -07:00
Jonathan
17c11ba7b9 fix: updated remaining files 2023-09-21 11:48:52 -03:00
Jonathan
2a1daca1ca chore: rename license file 2023-09-19 14:41:21 -03:00
Steve Gravrock
f0db5ce350 Added Firefox 115 (current ESR) to supported browsers 2023-09-07 21:43:24 -07:00
Steve Gravrock
39f9c2e1a0 Don't attach spec helpers to the env 2023-08-26 11:52:26 -07:00
Steve Gravrock
bff612a169 Bump version to 5.1.1 2023-08-24 19:00:26 -07:00
Steve Gravrock
4ba42f3746 Fixed global variable leak when using ParallelReportDispatcher 2023-08-22 19:34:22 -07:00
Steve Gravrock
58bee05c36 Documented usage of eval in DelayedFunctionScheduler 2023-08-22 19:28:20 -07:00
Steve Gravrock
c1871b0f0c Removed unnecessary throw when building stack trace
Since 4.0, all supported JS runtimes populate the stack property of
Error objects when the Error is instantiated, not when it's thrown.
2023-08-19 09:54:03 -07:00
Steve Gravrock
c16974b091 Improved jsdocs for originalFn argument to createSpy
Fixes jasmine.github.io#137.
2023-08-14 18:32:51 -07:00
Steve Gravrock
bfedda9764 Link to 5.0 upgrade guide in README, not 4.0 2023-08-12 17:26:39 -07:00
Steve Gravrock
a67b7276be Fixed jsdocs for throwUnless and throwUnlessAsync 2023-07-22 09:36:16 -07:00
Steve Gravrock
47f3105ef0 Bump version to 5.1.0 2023-07-22 09:12:36 -07:00
Steve Gravrock
aeb56539c9 Built distribution 2023-07-22 09:12:18 -07:00
Steve Gravrock
75d45efa16 Exclude inherited Error properties from stack trace
These are likely to be methods or other things that aren't meaningful in
Jasmine's output.
2023-07-19 19:13:24 -07:00
Steve Gravrock
59d1c5bebb Use "bug report" tag, not "unconfirmed bug" 2023-07-19 18:29:51 -07:00
Steve Gravrock
040983c979 Merge branch 'skip-non-error-cause' of https://github.com/angrycat9000/jasmine
* Merges #2013 from @angrycat9000
* Fixes #2011
2023-07-19 18:28:56 -07:00
angrycat9000
2ddb344bac Skip parsing cause if it is not an Error object 2023-07-19 10:00:50 -04:00
Steve Gravrock
e56bd3918b Added throwUnless and throwUnlessAsync
These are similar to `expect` and `expectAsync` except that they throw
exceptions rather than recording matcher failures as spec/suite failures.
They're intended to support using Jasmine matchers in testing-library's
`waitFor`, and also provide a way to integration-test custom matchers.

These funtions are not equivalent to `expect` and `expectAsync` and should
not be used in situations where you want a matcher failure to reliably fail
the spec. Whether that happens depends on the structure of the surrounding
code. In general, you should only use `throwUnless` when you expect
something (which could be your own code or library code like `waitFor`) to
catch the resulting exception.

Fixes #2003.
Fixes #1980.
2023-07-15 12:08:11 -07:00
Steve Gravrock
59600a1c29 Removed expect/expectAsync indirection through spec/suite 2023-07-15 12:08:11 -07:00
Steve Gravrock
f8e4ea868f CI: Use a globally-unique Sauce tunnel ID
CIRCLE_BUILD_NUM is only unique per-repo, and we have multiple repos
that can concurrently run Sauce builds.
2023-07-01 11:05:04 -07:00
Steve Gravrock
0ff56c53b1 Dogfood remote Selenium grid support 2023-07-01 10:17:05 -07:00
Steve Gravrock
b617d983de Bump version to 5.0.1 2023-06-09 16:24:00 -07:00
Steve Gravrock
8e0f0e8e8c Optionally restore the pre-5.0 behavior of boot() always creating a new instance
This is needed by jasmine-npm (and likely other tools like it) that may
need to create and use multiple envs in sequence.
2023-06-05 19:44:06 -07:00
Steve Gravrock
d745d6b5f0 Bump version to 5.0.0 2023-05-13 15:14:53 -07:00
Steve Gravrock
fc2c2a477d Updated most dev dependencies
Not updating Prettier because newer versions impose significant formatting
changes. In particular, 2.0 changes every function definition from
`function() {` to `function () {` with no way to opt out. I'm not willing
to accept that kind of churn just becuse the Prettier devs changed their
mind about what color the bikeshed should be.

We'll most likely stay on Prettier 1.17 for as long as it remains viable,
then either switch to an autoformatter that offers stability or just
remove it.
2023-05-13 12:03:45 -07:00
Steve Gravrock
ff93277c0f Accessibility: Always provide a non-color indication that a spec is pending 2023-04-29 11:45:21 -07:00
Steve Gravrock
90741b3cee Accessibility: Improved contrast of version number and inactive tab links 2023-04-29 11:45:16 -07:00
Steve Gravrock
d1de59f0ed Updated jasmine dev dependency 2023-04-29 10:53:03 -07:00
Steve Gravrock
73f8e001ad Bump version to 5.0.0-beta-0 2023-04-29 10:10:05 -07:00
Steve Gravrock
390cc45af2 Dropped support for Node 16
Node 16 will reach EOL no later than a few months after Jasmine 5 is
released. Experience with Node 12 and Node 14 has shown that our
dependencies, especially dev dependencies, move on from past-EOL Node
versions fairly quickly. That can make it difficult to continue supporting
them. Since long term support for past EOL Node versions is a non-goal and
many users expect that Node versions will only be dropped in major
releases, it's better to drop it in 5.0.
2023-04-27 19:32:18 -07:00
Steve Gravrock
33118ac6e2 Merge branch 'main' into 5.0 2023-04-27 19:22:30 -07:00
Steve Gravrock
31ff9a300c Added Node 20 to supported environments 2023-04-22 08:12:49 -07:00
Steve Gravrock
5cc739d879 Bump version to 5.0.0-alpha.1 2023-04-08 13:02:21 -07:00
Steve Gravrock
1e7f07259e API docs for parallel support things that jasmine-npm uses 2023-04-08 12:37:40 -07:00
Steve Gravrock
c36a5cfd96 Parallel: Cleaner interface for reporter dispatching
This gets jasmine-npm out of having to deal with QueueRunner, GlobalErrors,
and ReportDispatcher directly.
2023-04-08 11:41:15 -07:00
Steve Gravrock
299fd1f770 Removed unnecessary TODO 2023-03-25 11:21:04 -07:00
Steve Gravrock
656427d328 Parallel: Disallow calls to Env#config from spec and helper files
Such configuration changes only affect one worker, which is almost certainly
not the intent.
2023-03-25 11:16:54 -07:00
Steve Gravrock
621522fdd4 Updated Glob 2023-03-21 22:35:15 -07:00
Steve Gravrock
6e3589bf52 Updated most dev dependencies 2023-03-21 22:33:24 -07:00
Steve Gravrock
df2d9b282e Bump version to 5.0.0-alpha.0 2023-03-18 11:25:32 -07:00
Steve Gravrock
726d35c5c5 Merge remote-tracking branch 'origin/main' into 5.0 2023-03-15 17:53:08 -07:00
Steve Gravrock
f509078020 Bump version to 4.6.0 2023-03-15 17:21:56 -07:00
Steve Gravrock
8308515210 Ignore the number of CPUs reported by Circle CI 2023-03-12 15:31:28 -07:00
Steve Gravrock
ed838b3cbf Dropped support for Node <16.14
To match jasmine-npm.
2023-03-11 21:19:30 -08:00
Steve Gravrock
04fac300e8 Uninstall the global error at the end of env execution
jasmine-npm needs this so that it can do its own error handling during
globalTeardown.
2023-03-11 17:45:31 -08:00
Steve Gravrock
ff237f4b66 Fixed sass version pinning 2023-03-11 14:26:22 -08:00
Steve Gravrock
e42e3d9e00 Pin sass to the last version that works on Node 12 2023-03-11 14:19:16 -08:00
Steve Gravrock
61505f4c59 Fixed post-merge test failures 2023-03-04 14:10:05 -08:00
Steve Gravrock
86eddb05b4 Merge remote-tracking branch 'origin/main' into 5.0 2023-03-04 14:06:43 -08:00
Steve Gravrock
8af5509581 Added a parallel flag to the jasmineStarted reporter event 2023-03-03 20:49:10 -08:00
Steve Gravrock
166e5f4d6c Report the ID of each suite/spec's parent
This is intended to support parallel execution, which is planned for a
future release of Jasmine. Because the execution of unrelated suites will
interleave when run in parallel, reporters will not be able to assume
that the most recent `suiteStarted` event identifies the parent of the
current suite/spec. By adding this feature now, we allow reporters to
support both parallel execution and at least some 4.x versions without
having to implement two different ways of finding the parent suite.
2023-02-25 10:24:14 -08:00
Steve Gravrock
6ad8d20694 Report the path/url of the file that the spec/suite was defined in
Fixes #1884
2023-02-15 21:39:21 -08:00
Steve Gravrock
cbc03feb52 Merge branch 'main' into 5.0 2023-02-12 13:08:42 -08:00
Steve Gravrock
bc3a495160 Pin eslint-plugin-compat to <4.1.0 to fix import error on CI
See <https://github.com/amilajack/eslint-plugin-compat/issues/528>.
2023-02-07 18:46:17 -08:00
Steve Gravrock
b323631611 Pin Grunt to <1.6.0 for compatiblity with Node 12 2023-01-30 17:57:47 -08:00
Steve Gravrock
e8767ba660 Removed "Does the problem occur with the latest version of jasmine-core" from issue templates 2023-01-25 20:50:51 -08:00
Steve Gravrock
af9a4114f4 Parallel: Improved error messages for top-level before/afterAll 2022-11-25 13:13:05 -08:00
Steve Gravrock
75f97961f5 Dropped support for Safari 14 and Firefox 91 2022-11-24 13:25:39 -08:00
Steve Gravrock
25a7168286 Merge remote-tracking branch 'origin/main' into 5.0 2022-11-24 12:50:39 -08:00
Steve Gravrock
494e81f436 Document that stopOnSpecFailure is best-effort in parallel mode 2022-11-24 12:48:40 -08:00
Steve Gravrock
169a2a8ad2 Upgraded to new issue templates 2022-11-20 14:01:43 -08:00
Steve Gravrock
b267029301 Revert "Upgraded to new issue templates"
This reverts commit cf574634b8.
2022-11-20 13:58:20 -08:00
Steve Gravrock
cf574634b8 Upgraded to new issue templates 2022-11-20 13:56:47 -08:00
Steve Gravrock
f8c01574e6 Added Firefox 102 (current ESR) to browser list in README 2022-10-29 15:26:30 -07:00
Steve Gravrock
481f1e7c5c Bump version to 4.5.0 2022-10-29 14:48:32 -07:00
Steve Gravrock
5e650953cd Added Safari 16 to supported browsers 2022-10-22 13:08:10 -07:00
Steve Gravrock
ed5e902106 Parallel: Don't allow reporters to be added or removed in worker processes 2022-10-22 09:56:52 -07:00
Steve Gravrock
87f9ab29df Fixed the jsdoc types of SuiteResult and SpecResult ids 2022-10-19 17:20:24 -07:00
Steve Gravrock
47c64a86d5 Parallel: fail if randomization is disabled or a seed is specified 2022-10-12 20:08:42 -07:00
Steve Gravrock
bb497beeff Parallel: throw if Env#topSuite is called 2022-10-11 20:16:36 -07:00
Steve Gravrock
e14d9c4be3 Parallel: forbid beforeAll/afterAll at the top level
Either running these once total or running them once per process
would be the wrong choice for a significant chunk of users, so do
neither. Later we'll add a new API for exactly-once setup and teardown
in parallel mode.
2022-10-11 20:10:02 -07:00
Steve Gravrock
89e0b35c53 Parallel: throw an error if fit/fdescribe are used in parallel mode 2022-10-11 19:35:59 -07:00
Steve Gravrock
1e7b68236b Parallel: forbid beforeEach/afterEach at the top level of spec files
Each spec file is only loaded in a single worker, so top level
before/afterEach can't behave consistently.

beforeEach/afterEach are still supported in:
* Helper files
* describe() blocks
* At the top level of spec files in non-parallel mode
2022-10-11 19:25:39 -07:00
Steve Gravrock
394068f863 Depend on -npm 5.0 2022-10-08 15:39:57 -07:00
Steve Gravrock
b831e81074 Include inner exceptions in stack traces 2022-09-24 12:12:21 -07:00
Steve Gravrock
4c13c2b00b Replaced var with const in API doc examples 2022-09-24 10:12:22 -07:00
Steve Gravrock
dd98a45003 Use lcoal core when running our own tests in parallel 2022-09-18 19:59:21 -07:00
Steve Gravrock
fe6762b470 Merge branch '5.0' into parallel 2022-09-18 16:42:25 -07:00
Steve Gravrock
fa16b74500 Merge branch 'main' into 5.0 2022-09-18 13:39:05 -07:00
Steve Gravrock
4cd190b232 Merge branch 'internal-async' 2022-09-18 13:31:43 -07:00
Steve Gravrock
6ada55ff77 Parallel: Fixed reporting of exceptions thrown by a describe 2022-09-18 12:10:34 -07:00
Steve Gravrock
735ce6f758 Merge remote-tracking branch 'origin/5.0' into parallel 2022-09-18 09:43:31 -07:00
Steve Gravrock
430324885b Merge branch 'main' into 5.0 2022-09-18 09:41:45 -07:00
Steve Gravrock
7c2e8ce7ca Merge branch 'main' into parallel 2022-09-17 13:26:37 -07:00
Steve Gravrock
d4025999b7 Report exceptions thrown by a describe before any it calls
Previously, these were masked by the "describe with no children" error.
Now they're reported as suite level errors on an empty suite.
2022-09-17 13:24:45 -07:00
Steve Gravrock
871111424d Use one worker per CPU when running own specs in parallel 2022-09-17 12:20:05 -07:00
Steve Gravrock
44f331f43d Updated the style of the examples
* const/let instead of var
* classes
* pass our own eslint checks
2022-09-17 12:00:20 -07:00
Steve Gravrock
213144413f Test parallel operation in CI 2022-09-17 11:44:24 -07:00
Steve Gravrock
2272f9aead Parallel: run our own specs in parallel 2022-09-17 11:35:03 -07:00
Steve Gravrock
59848ca151 Coerce the random string to a seed before sending it to reporters
This fixes an error in HTMLReporter when the configured seed is a
number rather than a string, which has been allowed since 3.8.0
2022-09-03 12:36:35 -07:00
Steve Gravrock
c14bfe3e5f Updated release process doc
* Fixed description of patch releases
* Moved -npm release docmentation to that repo
* Refer to -npm specifically rather than "binding libraries" generally,
  now that we only have one of those that versions in lockstep with core.
2022-09-03 11:02:13 -07:00
Steve Gravrock
26c48ab324 Bump version to 4.4.0 2022-09-03 09:42:39 -07:00
Steve Gravrock
4c8d57e14c Dropped support for Node 14 2022-08-27 10:47:40 -07:00
Steve Gravrock
543689e206 Depend on -npm from github 2022-08-27 10:46:25 -07:00
Steve Gravrock
ee524831f4 Merge branch 'main' into parallel 2022-08-27 10:30:21 -07:00
Steve Gravrock
cfecab9f79 Updated contributing guide 2022-08-22 18:10:33 -07:00
Steve Gravrock
b3d9435dbb Convreted TreeProcessor to async/await 2022-08-22 17:04:44 -07:00
Steve Gravrock
fec8dd37b0 Merge branch 'main' into internal-async 2022-08-22 10:46:03 -07:00
Steve Gravrock
0690500a0d Breaking change: Made Env#execute async
Errors related to invalid spec order are now reported via promise
rejection rather than synchronous throw.
2022-08-21 16:40:03 -07:00
Steve Gravrock
0bfbda720d Breaking change: Env#execute no longer takes a callback
Use the returned promise instead.
2022-08-21 16:35:12 -07:00
Steve Gravrock
4fcdbd39fb Breaking change: use addEventListener rather than setting window.onerror
* Generally simplifies error handling in browsers
* Makes Jasmine's own integration tests easier to debug
* Stack traces will be provided for more global errors
* ... but less error information will be provided in some browsers if the
  error comes from a file:// URL (use `npx serve` or similar instead)
* Jasmine will no longer override existing onerror handlers in browsers
* Setting window.onerror will no longer override Jasmine's global error
  handling (use jasmine.spyOnGlobalErrors instead)
2022-08-21 16:17:18 -07:00
Steve Gravrock
f934e6d816 Assume that addEventListener/removeEventListener are present in browsers
Jasmine 3.0 dropped support for the last browser that didn't support
the standard event handler methods (IE 9).
2022-08-20 10:27:44 -07:00
Steve Gravrock
79c6bbc189 clearStack optimizations
* Avoid setTimeout in Node, because we don't need the overhead there.
* Still call setTimeout in browsers to prevent the tab from being killed.
* Use queueMicrotask in Safari, because it's dramatically faster than
  MessageChannel there.
* Continue to use MessageChannel in other supported browsers becuase it's
  somewhat faster than queueMicrotask there.
* Don't use setImmediate any more because there's a faster alternative in
  all supported envs.

In jasmine-core's own test suite, this yields a roughly 50-70% speedup
in Node, ~20% in Edge, and 75-90%(!) in Safari.
2022-08-15 17:50:49 -07:00
Steve Gravrock
2e80ec0c22 Rm dead code for QueueRunner deprecations 2022-08-11 19:51:08 -07:00
Steve Gravrock
588283cfe5 Breaking change: support for -npm reporter handling in parallel mode
* The `boot` function exported by the core module returns the same object
  every time it's called.
* Removed node_boot.js. Use the exported `boot` function instead
* JasmineStartedInfo does not have totalSpecsDefined or order in parallel mode
* JasmineDoneInfo does not have order in parallel mode
* Added incompleteCode and numWorkers to JasmineDoneInfo
2022-08-10 18:23:38 -07:00
Steve Gravrock
3a43871901 Reset the env state between parallel batches 2022-08-06 10:55:02 -07:00
Steve Gravrock
fcbab02b2d Droped support for Node 12 2022-08-06 10:55:02 -07:00
Steve Gravrock
5f3475342e Re-added missing JasmineStartedInfo jsdoc 2022-08-06 10:53:28 -07:00
Steve Gravrock
e022e6199c Bump version to 4.3.0 2022-07-23 10:27:19 -07:00
Steve Gravrock
140c12e8fc Added Firefox 102 (current ESR) to CI 2022-07-23 10:17:21 -07:00
Steve Gravrock
21f25972bb Converted ReportDispatcher to promises 2022-07-01 17:25:22 -07:00
Steve Gravrock
d0e1bd96fb README updates
* Removed redundancy
* Added a link to the FAQ
* Removed obsolete support channels
2022-07-01 16:58:38 -07:00
Steve Gravrock
6c56ebc984 Added jasmine.spyOnGlobalErrorsAsync
* Allows testing code that's expected to prodeuce global errors or
  unhandled promise rejections
* Fixes #1843
* Fixes #1453
2022-06-30 18:09:56 -07:00
Steve Gravrock
d0a9931ae6 Separated reporter- and runable-specific queue runner configuration 2022-06-12 15:52:14 -07:00
Steve Gravrock
93c5f654d9 Extracted most suite-running code out of Env 2022-06-12 15:46:03 -07:00
Steve Gravrock
d8b65028a1 Pass queue runner factory to Spec#execute, not ctor 2022-06-12 12:34:46 -07:00
Steve Gravrock
d6cdc1841c Extracted suite building out of Env 2022-06-12 09:49:01 -07:00
Steve Gravrock
72b39220e5 Runable, not runnable 2022-06-11 15:41:29 -07:00
Steve Gravrock
55dce7d119 Extracted runnable resource management out of Env 2022-06-11 15:28:37 -07:00
Steve Gravrock
789736dd02 Additional test coverage for default spy strategies 2022-06-11 15:08:02 -07:00
Steve Gravrock
c7ca3b0101 Converted integration specs to async/await 2022-06-11 13:43:44 -07:00
Steve Gravrock
96000220b1 Use arrow fns rather than self = this 2022-06-11 12:12:11 -07:00
Steve Gravrock
e2e2275d41 Removed obsolete and unused utility fns 2022-06-11 11:17:16 -07:00
Steve Gravrock
135ff20123 Replaced uses of var with const/let 2022-06-09 20:00:23 -07:00
Steve Gravrock
4af86f5398 Added supported envs to releasen notes 2022-06-09 18:25:04 -07:00
Steve Gravrock
e5e0e6481d Bump version to 4.2.0 2022-06-09 18:18:45 -07:00
Steve Gravrock
bcf69b86b4 Removed duplicate Suite and Spec jsdocs 2022-06-03 12:22:58 -07:00
Steve Gravrock
a5f79fac81 Removed remaining jshint config comments 2022-06-02 18:22:23 -07:00
Steve Gravrock
18a00822c5 Built distribution 2022-06-02 11:37:10 -07:00
Steve Gravrock
4cc8437f79 Call buildExpectationResult directly from Suite and Spec
This removes quite a bit of indirection from result processing, at the
cost of making a few of the tests more awkward.
2022-06-01 10:18:23 -07:00
Steve Gravrock
8e58305b0a ExpectationResult.js -> buildExpectationResult.js 2022-06-01 09:26:21 -07:00
Steve Gravrock
bd368aceee Replaced var with const and let in expectation related code 2022-06-01 09:22:03 -07:00
Steve Gravrock
8f16021887 Replaced var with const and let in ExpectationResult 2022-06-01 09:02:43 -07:00
Steve Gravrock
bbb1b69b2e More reliably report errors that occur late in the suite/spec lifecycle
Previously, an error that occurred after Jasmine started to report the
suiteDone or specDone event for the current runable would not be reliably
reported. Now such an error is reported on the nearest ancestor suite whose
suiteDone event has not yet been reported.
2022-05-28 18:10:55 -07:00
Steve Gravrock
9ea8a2096f Additional integration tests for existing async error handling 2022-05-28 18:01:19 -07:00
Steve Gravrock
66340e2b19 Updated browserslist to match 4.0 envs 2022-05-28 18:00:45 -07:00
Steve Gravrock
fe29dfa89c Update release process instructions
* Need to tag the release manually since the Ruby tooling for that was
  removed
* Windows CI works again, so no need to manually test on Windows
2022-05-21 09:43:43 -07:00
Steve Gravrock
41f7fabe2f Renamed jasmine.exactly to jasmine.is, for similarity with toBe 2022-05-21 08:30:53 -07:00
Steve Gravrock
856a040a2d Fixed flaky spec 2022-05-19 16:39:48 -07:00
Steve Gravrock
f7eaa5ec29 Fixed failing CI builds for Node 12 and 14
See https://github.com/npm/cli/issues/4896
2022-05-16 19:53:20 -07:00
Steve Gravrock
0c87d47318 Added a jasmine.exactly asymmetric equality tester 2022-05-14 17:01:38 -07:00
Steve Gravrock
c24b2f5a73 Converted some integration specs to async/await 2022-05-14 12:05:53 -07:00
Steve Gravrock
774c83a36e Don't report a deprecation when a runnable uses two forms of async
This was made into an error in 4.0, so the deprecation is redundant
(and broken).
2022-05-14 11:21:40 -07:00
Steve Gravrock
751cf6ab5b Converted DiffBuilder, ObjectPath, MismatchTree, and SinglePrettyPrintRun to ES6 classes 2022-05-14 11:15:08 -07:00
Steve Gravrock
2fd76c954c Replaced var with let and const in PrettyPrinter, DiffBuilder, and friends 2022-05-14 09:42:07 -07:00
Steve Gravrock
bb4d18f959 Include property getter values in pretty-printed objects
We already call getters when comparing objects for equality and generating
diffs, so it should be safe to do it here too.

See #1966.
2022-05-12 17:14:13 -07:00
Steve Gravrock
68eaa64c31 Bump version to 4.1.1 2022-05-09 17:49:42 -07:00
Steve Gravrock
81f6eb45ea Cleaned up specs for symbol property filtering
* Removed redundant spec
* Test the behavior of jasmineUnderTest, not the host jasmine
2022-05-09 17:11:36 -07:00
Steve Gravrock
841b212c66 Merge branch 'patch-1' of https://github.com/suke/jasmine
* Merges #1963 from @suke
* Excludes non-enumerable symbol properties from equality comparison
2022-05-09 16:51:47 -07:00
Steve Gravrock
9a27407d35 Folded util.objectDifference into MatchersUtil
This was always an implementation detail of objectKeysAreDifferentFormatter,
and didn't really do what its name suggested.

* #1966
2022-05-07 14:03:26 -07:00
Steve Gravrock
468e9577cd Include symbol properties in matcher diffs
* #1966
2022-05-07 13:26:15 -07:00
Steve Gravrock
9d80377fe3 Fixed exception when comparing arrays with Symbol keys
* Fixes #1966
2022-05-07 10:42:29 -07:00
Steve Gravrock
270344bd38 Include symbol keys when pretty-printing objects
* Fixes #1966
2022-05-07 10:05:18 -07:00
suke
dfa94c70c1 toEqual does not compare symbols that cannot be enumerated 2022-04-27 10:51:03 +09:00
Steve Gravrock
694375e4ea Added Node 18 to CI matrix 2022-04-23 12:39:44 -07:00
Steve Gravrock
1166d10e43 Use const/let in specs, not var 2022-04-16 13:41:44 -07:00
Steve Gravrock
482dc883eb Check for unused vars and params in specs 2022-04-16 10:58:25 -07:00
Steve Gravrock
364cf35474 Fixed shared example for describe-like fns 2022-04-16 10:26:07 -07:00
Steve Gravrock
2e8732f30f Added supported envs to 4.1.0 release notes 2022-04-11 21:08:07 -07:00
Steve Gravrock
04133264e0 Bump version to 4.1.0 2022-04-11 20:24:42 -07:00
Steve Gravrock
d2bf6062cb README updates
* Replaced redundant installation instructions with link to docs
* Added links to usage instructions
* Fixes #1941
2022-04-09 11:20:54 -07:00
Steve Gravrock
fb639d0f55 toBeCloseTo treats Infinity and -Infinity as close to themselves
* Fixes #1957
2022-04-09 11:14:24 -07:00
Steve Gravrock
52b1a3a7f8 Merge branch 'refactor/rm-deprecated-substr' of https://github.com/CommanderRoot/jasmine
* Merges #1962 from @CommanderRoot
2022-04-02 10:32:59 -07:00
Steve Gravrock
1f7880ee8c Updated Sauce Connect 2022-03-29 20:57:49 -07:00
Steve Gravrock
a6e1aef8d7 Added debug logging to flaky spec 2022-03-29 20:57:49 -07:00
Steve Gravrock
d2815982ce Removed obsolete vendor-specific background-size rules
* Fixes #1961
2022-03-29 07:20:02 -07:00
Tobias Speicher
aa979277fb refactor: replace deprecated String.prototype.substr()
.substr() is deprecated so we replace it with functions which work similarily but aren't deprecated

Signed-off-by: Tobias Speicher <rootcommander@gmail.com>
2022-03-25 16:03:46 +01:00
Steve Gravrock
1e0c312f9f Merge branch 'main' of https://github.com/nitobuendia/jasmine
* Adds toHaveSpyInteractions matcher
* Merges #1959 from @nitobuenida
* Fixes #1568
2022-03-18 11:10:39 -07:00
Nito Buendia
c5db939886 Run cleanup 2022-03-17 21:09:14 +08:00
Nito Buendia
e470fb56d7 Refactor error message to account for negate comparisons
The message return on negate clause was not expected. This makes it negative to match expectation. This also add tests for the change, and renames some tests to make it more clear.
2022-03-17 21:06:51 +08:00
Nito Buendia
a8a6577cd7 Replace parameterized test with different expectations
This approach makes it hard to scale and goes against DRY and debuggability vs the previous approach which followed Python parameterized testing, but this was the recommendation of the Jasmine team to keep it consistent with other tests.

Further tests here could be adding other types like Array, Map, WeakMap, Set, WeakSet...
2022-03-17 20:16:22 +08:00
Nito Buendia
1660015c12 Run formatter 2022-03-16 23:01:20 +08:00
Nito Buendia
faf210ab4c Remove dependency on matchersUtil for test 2022-03-16 23:00:27 +08:00
Nito Buendia
00fd4a819f Refactor tests to depend on jasmineUnderTest 2022-03-16 21:48:03 +08:00
Nito Buendia
091cd8c3b6 Remove spyObj setup from test that does not require it 2022-03-16 21:34:28 +08:00
Nito Buendia
aba0c98eb9 Fix unit test to include testValue instead of a constant value 2022-03-16 21:31:40 +08:00
Nito Buendia
a7eff79db0 Simplify test for arguments passed 2022-03-16 21:26:59 +08:00
Nito Buendia
2a5673e6ab Change jasmine to jasmineUnderTest 2022-03-16 21:20:21 +08:00
Nito Buendia
c13dd26c4b Change set up to each of the formats
This goes against DRY principle, but it was recommended by Jasmine team to reduce coupling between tests.
2022-03-16 21:18:25 +08:00
Nito Buendia
2e8b477489 Change arrow functions with anonymous functions 2022-03-16 21:14:43 +08:00
Nito Buendia
b2c2e08641 Remove @since tag from JSDoc 2022-03-16 20:15:09 +08:00
Nito Buendia
d7d75abc42 Rename spec to include Spec to allow running 2022-03-16 20:14:06 +08:00
Nito Buendia
0b71d0a2a0 Merge branch 'jasmine:main' into main 2022-03-16 20:09:19 +08:00
Steve Gravrock
dfa5b6a53d Pretty-print [new String("")] as "[ '' ]" not "[]" 2022-03-14 18:47:23 -07:00
Steve Gravrock
7f75f23e5b Use new Circle CI images
The old images are deprecated:
<https://discuss.circleci.com/t/legacy-convenience-image-deprecation/41034>
2022-03-09 13:05:34 -08:00
Steve Gravrock
502cb24bb8 Merge branch '4.0.1' 2022-02-21 17:08:11 -08:00
Steve Gravrock
0ae234dc6e Bump version to 4.0.1 2022-02-21 16:58:32 -08:00
Steve Gravrock
38d102f1d1 Merge branch '3.99.1' into 4.0.1 2022-02-21 16:45:34 -08:00
Steve Gravrock
906f37fe52 Bump version to 3.99.1 2022-02-21 16:30:15 -08:00
Steve Gravrock
4a2b10998a Remove Safari 8 and 9 from CI matrix
These browsers are still nominally supported by Jasmine 3.x, but they no
longer work on Saucelabs.
2022-02-19 14:23:02 -08:00
Steve Gravrock
d8b2efe4d6 Downgrade jasmine-browser-runner for compatibility with IE 2022-02-19 14:21:35 -08:00
Steve Gravrock
9d9e8f0c17 Lint fixes 2022-02-19 12:33:19 -08:00
Steve Gravrock
4059ab7ba6 Don't report a deprecation when a promise is resolved to something
beforeEach(() => somePromiseReturningFn()) is likely a common idiom
and we don't want to treat it as an error.

* Fixes #1958
2022-02-19 12:28:47 -08:00
Nito Buendia
7b01003d0b Add specs for the new toHaveSpyInteractions matcher 2022-02-16 21:11:42 +08:00
Nito Buendia
8e85f3df74 Create toHaveSpyInteractions matcher
This matcher checks all the properties of a given spy object and checks whether at least one of the spies has been called. It returns true if one or more of the spies of the spy object has been called and false otherwise.
2022-02-16 21:10:31 +08:00
Steve Gravrock
b0034797fe Merge branch 'fix-save-args-by-value' of https://github.com/coyoteecd/jasmine
* Fixes cloning of Date objects in saveArgumentsByValue()
* Merges #1955 from @coyoteecd
* Fixes #1885
2022-02-02 21:18:38 -08:00
Dan Cortel
83e9f88952 Make saveArgumentsByValue clone Date objects correctly
* Fixes #1885
2022-01-26 18:32:05 +02:00
Gwendolyn Van Hove
de13b47809 Update maintainers list 2022-01-20 15:57:48 -08:00
Steve Gravrock
9e10743a1c Include the name of the suite in the empty suite error message 2022-01-17 15:08:56 -08:00
Steve Gravrock
5327157832 Always run formerly flaky specs 2022-01-17 14:54:21 -08:00
Steve Gravrock
6e3128c792 Merge branch 'SymboltoEqual' of https://github.com/laeleoni/jasmine
* Merges #1879 from @laeleoni
* Fixes #1879
2022-01-15 11:44:53 -08:00
Steve Gravrock
bd2e877f4e Removed scheduled workflows from Circle CI config
Scheduled pipelines (configured via the Circle web UI) will be used instead.
2022-01-15 10:50:03 -08:00
Steve Gravrock
5b23ffe174 Merge pull request #1951 from ath0mas/patch-1
Update html example in README
2022-01-04 20:37:03 -08:00
Alexis THOMAS
384e0859c7 Update html example in README
Follow SpecRunner.html: Simplifies types (197cb13817) and Split boot.js in two (286524959b)
2022-01-04 23:51:30 +01:00
Steve Gravrock
616682e487 Stop cron builds on 3.99 and 4.0 2022-01-01 13:29:39 -08:00
Steve Gravrock
98c2f019c6 Bump version to 4.0.0 2022-01-01 12:43:29 -08:00
Steve Gravrock
507dad6d87 Set -npm and -browser-runner dev dependencies back to main 2022-01-01 12:10:24 -08:00
Steve Gravrock
6da7a32442 Merge branch '4.0' 2022-01-01 12:00:46 -08:00
Steve Gravrock
58d13570ac Bump version to 3.99.0 2022-01-01 10:47:59 -08:00
Steve Gravrock
005648acd8 Built distribution 2022-01-01 10:46:15 -08:00
Steve Gravrock
ff14c03a40 Test against the latest Node 12 2022-01-01 08:44:28 -08:00
Steve Gravrock
ff848c812a Merge branch 'main' into 4.0 2021-12-31 15:07:03 -08:00
Steve Gravrock
d963be5eec Log a deprecation warning on reentrant calls to Clock#tick
See #1929
2021-12-31 11:38:01 -08:00
Steve Gravrock
8444faab72 Use the clock from jasmineUnderTest in specs 2021-12-31 10:00:14 -08:00
Steve Gravrock
883f400074 Merge branch '4.0' of https://github.com/thw0rted/jasmine into 4.0
* Fixes handling of reentrant calls to `jasmine.clock().tick()`
* Merges #1948 from @thw0rted
* Fixes #1929
2021-12-31 09:50:09 -08:00
Steve Gravrock
3c16caa413 Link to the CONTRIBUTING guide from the PR template 2021-12-31 09:47:46 -08:00
Steve Gravrock
5d0be2e6cf Updated the contributing guide for 4.0
* Moved "Before Submitting a Pull Request" to the top
* Removed discussion of the standard Github PR workflow
  (Contributors who don't know how to create PRs on Github at all can find
  that information elsewhere. For the rest, it's just noise.)
* Misc copy edits
2021-12-31 09:43:46 -08:00
James Bromwell
c56631175f Fix time-travel in delayed function scheduler 2021-12-29 17:50:48 +01:00
Steve Gravrock
cef738966c Updated dev dependencies 2021-12-21 17:51:28 -08:00
Steve Gravrock
5fd0e49ccf Removed unused ejs dev dependency 2021-12-21 17:00:10 -08:00
Steve Gravrock
c431590d65 Fixed reporting of suites that are skipped due to a beforeAll failure 2021-12-20 13:39:24 -08:00
Steve Gravrock
656e6614da Built distribution 2021-12-15 20:36:44 -08:00
Steve Gravrock
24408a16ed Removed initialization of unused Promise config property 2021-12-15 20:34:00 -08:00
Steve Gravrock
ca90c76d12 Merge branch '3.99' into 4.0 2021-12-14 08:27:05 -08:00
Steve Gravrock
57c294b307 Added a migration guide link to multiple done call deprecations 2021-12-14 08:16:06 -08:00
Steve Gravrock
e73eb18753 Test against jasmine-browser-runner 1.0.0-dev 2021-12-13 21:41:09 -08:00
Steve Gravrock
0411b0567d Added a mention of 4.0 migration to the README 2021-12-11 16:13:51 -08:00
Steve Gravrock
30b93ccdbb Updated jsdocs for Env#execute 2021-12-11 15:53:25 -08:00
Steve Gravrock
067b91b3ef Removed IE/PhantomJS support code 2021-12-11 14:57:41 -08:00
Steve Gravrock
0b1385c3d3 Report start and end events for specs/suites that are skipped due to a beforeAll error
This is noisier, but it maintains compatibility with reporters that assume
(quite reasonably) that all specs and suites are either filtered out or
reported.
2021-12-11 12:34:23 -08:00
Steve Gravrock
f1cf6ee419 Resolve the execute() promise to the entire JasmineDoneInfo
This matches jasmine-npm.
2021-12-09 18:18:36 -08:00
Steve Gravrock
b37d989f13 Removed past-EOL Firefox versions 2021-12-07 18:16:00 -08:00
Steve Gravrock
89151d6e64 Dropped Safari 13 from build matrix 2021-12-07 17:04:19 -08:00
Steve Gravrock
75e3e14861 Merge remote-tracking branch 'upstream/safari-15' into 4.0 2021-12-07 17:03:40 -08:00
Steve Gravrock
ce7460d8d4 Fixed stack trace filtering on Safari 15 2021-12-07 16:50:07 -08:00
Steve Gravrock
b8dabf96ff HTML: Include top suite failures in the reported failure count 2021-12-03 08:18:18 -08:00
Steve Gravrock
40fac8b6a2 Renamed the trace feature to debugLog[s]
"trace" was ambiguous and could easily be understood to have something
to do with stack traces.
2021-12-02 14:46:56 -08:00
Steve Gravrock
5eb42d67a7 Added a note about async testing style to contributing guide 2021-12-02 12:40:14 -08:00
Steve Gravrock
d739c23401 Resolve the promise returned by Env#execute to the overall status 2021-12-02 12:40:14 -08:00
Steve Gravrock
42e6c45efa Allow use without creating globals
* Fixes #1235
2021-11-29 20:37:07 -08:00
Steve Gravrock
5942654856 Merge branch '3.99' into 4.0 2021-11-26 13:27:57 -08:00
Steve Gravrock
f3b26a0688 Merge branch 'main' into 3.99 2021-11-26 13:25:14 -08:00
Steve Gravrock
8804ddb8cf Updated boot file lists for the Ruby gem and Python egg
This prevents consumers that rely on those lists (especially the Jasmine
gem and egg) from getting a deprecation warning about boot.js.
2021-11-24 15:38:40 -08:00
Steve Gravrock
439be97c34 Rephrased note about verboseDeprecations 2021-11-24 11:45:32 -08:00
Steve Gravrock
871ba99a30 Allow custom spy strategies to be inherited like other runnable resources 2021-11-17 12:50:16 -08:00
Steve Gravrock
7a685b16f6 Removed duplicate message from errors (incl. matcher failures) on V8 2021-11-16 12:52:07 -08:00
Steve Gravrock
2a049015b0 Use custom equality testers in Spy#withArgs
Fixes #1836.
2021-11-15 18:55:09 -08:00
Steve Gravrock
c48fb0b0e7 Added Firefox 91 (current ESR) to CI matrix 2021-11-14 14:18:06 -08:00
Steve Gravrock
4c47bf6c0b Merge branch '3.10.1' into main 2021-10-22 16:34:57 -07:00
Steve Gravrock
2a39339755 Merge branch 'fix/pending-reason' of https://github.com/jan-molak/jasmine into main
* Fixes missing pendingReason in pending spec results
	* Fixes #1939
	* Merges #1940 from @jan-molak
2021-10-22 14:09:48 -07:00
Jan Molak
2c440b8e44 Fixed result.pendingReason for specs marked with xit. Closes #1939 2021-10-22 17:58:31 +01:00
Steve Gravrock
8e74529631 Merge branch '3.99' into 4.0 2021-10-15 10:37:51 -07:00
Steve Gravrock
b13329114c Set version to 3.99.0-dev 2021-10-15 10:33:21 -07:00
Steve Gravrock
ab34f272da Merge branch 'main' into 3.99 2021-10-15 10:29:50 -07:00
Steve Gravrock
1af0e62ef7 Revert "Revert "Dogfood the new jasmine-npm completion interface""
This reverts commit 4c043717a9.
2021-10-14 07:07:10 -07:00
Steve Gravrock
c1db8f2f82 Clarified deprecation message for this in describes 2021-10-12 15:40:13 -07:00
Steve Gravrock
41f5c53959 Consistently identify clenaup fns by a type tag, not position
This was already done for everything except spec cleanup fns, since the
various skip policies need to know the difference between afterEach and
afterAll.
2021-10-11 18:05:57 -07:00
Steve Gravrock
25c3f06839 Run afterAll fns after failure even if stopOnSpecFailure is true
[#160905297]
2021-10-08 14:19:56 -07:00
Steve Gravrock
976928c7ae Set version to 4.0.0-pre.0 2021-10-08 08:48:22 -07:00
Steve Gravrock
36a4ddf433 Revert "Removed jsdoc entry for SpecResult#trace"
This reverts commit 4482355885.
2021-10-07 10:56:52 -07:00
Steve Gravrock
53b1cd37b6 Merge branch '3.99' into 4.0 2021-10-07 10:56:41 -07:00
Steve Gravrock
8cadfbd829 Fixed deprecation warning in spec 2021-10-07 10:51:06 -07:00
Steve Gravrock
86aeb5c88a Merge branch 'main' into 3.99 2021-10-07 10:38:35 -07:00
Steve Gravrock
d4c15b8df4 No longer test Node <12.17 2021-10-06 17:58:28 -07:00
Steve Gravrock
6f0c51260f Depend on the 4.0 branch of -npm 2021-10-06 17:54:54 -07:00
Steve Gravrock
15710937b8 Added a test that verifies skip to cleanup fns after pending()
Because pending() is implemented via the standard exception handling
path, we effectively got this feature for free as a result of the changes
for #1533, particularly 457a2727.

* [#178598493]
* Fixes #1579
2021-10-06 11:07:53 -07:00
Steve Gravrock
1a9d16715d Clarify which behaviors are specific to different stopSpecOnExpectationFailure values
* #1533
2021-10-06 08:55:01 -07:00
Steve Gravrock
b67a3043c7 Skip afterEach fns in nested suites when a beforeEach fn errors
This matches the behavior of beforeAll errors.

* #1533
2021-10-06 08:55:01 -07:00
Steve Gravrock
5f1ef5ac2b Skip everything except afterAll fns when a beforeAll fn errors
* Fixes #1533
2021-10-06 08:55:01 -07:00
Steve Gravrock
5eaeeb0b6c Moved fn skipping policy out of QueueRunner
This should allow us to more easily support complex skipping strategies
like skipping nested cleanup fns when the corresponding befores were
skipped, or skipping specs and suites when a beforeAll fails.

* #1533
2021-10-06 08:55:01 -07:00
Steve Gravrock
457a2727ba Skip to afterEach fns when a beforeEach fn errors
* #1533
2021-10-06 08:55:01 -07:00
Steve Gravrock
a1f14efac6 Improved specs for stopSpecOnExpectationFailure
* #1533
2021-10-06 08:55:01 -07:00
Steve Gravrock
b2067d9ce0 Fixed references to Env#trace in jsdocs 2021-10-02 09:58:47 -07:00
Steve Gravrock
47081258cd Revert "Revert "Added the ability to associate trace information with failing specs""
This reverts commit fdad8849df.
2021-10-02 09:56:25 -07:00
Steve Gravrock
9c03d4d3e9 Merge branch '3.99' into 4.0 2021-10-02 09:52:43 -07:00
Steve Gravrock
7f0087b805 Merge branch 'main' into 3.99 2021-10-02 09:47:30 -07:00
Steve Gravrock
35064cf60e Merge branch '3.99' into 4.0 2021-09-24 14:31:02 -07:00
Steve Gravrock
fb4c16b23e Merge branch 'main' into 3.99 2021-09-24 14:27:15 -07:00
Steve Gravrock
3b28ee7c29 Fixed extra deprecation when passing custom equality testers to MatchersUtil#contains 2021-09-24 14:25:54 -07:00
Steve Gravrock
3a77ae3dfe Throw if the argument to jasmine.clock().mockDate() is not a Date 2021-09-23 16:10:59 -07:00
Steve Gravrock
1332f01ca4 Merge branch '3.99' into 4.0 2021-09-23 16:08:44 -07:00
Steve Gravrock
64d58ed1f0 Deprecate non-Date arguments to jasmine.clock().mockDate() 2021-09-23 16:04:39 -07:00
Steve Gravrock
497a7fc3e5 Merge branch 'main' into 3.99 2021-09-23 15:49:47 -07:00
Steve Gravrock
8d302d8dca Merge branch '3.99' into 4.0 2021-09-20 15:57:37 -07:00
Steve Gravrock
760f2d9003 Removed additional Ruby support files 2021-09-18 09:40:30 -07:00
Steve Gravrock
6e10f22403 Don't display late errors as AfterAll errors in the HTML reporter 2021-09-11 08:57:50 -07:00
Steve Gravrock
d092a59bd1 Treat multiple calls to done callbacks as errors 2021-09-10 18:07:35 -07:00
Steve Gravrock
af5984d5d6 Fixed flake list 2021-09-10 17:53:59 -07:00
Steve Gravrock
15f7013f85 Merge branch '3.99' into 4.0 2021-09-08 21:04:10 -07:00
Steve Gravrock
be23836c9d Deprecate multiple calls to done callbacks 2021-09-08 20:58:25 -07:00
Steve Gravrock
7944250290 Merge branch 'main' into 3.99 2021-09-06 17:39:28 -07:00
Steve Gravrock
bbcb5ff42f Fixed linter & formatter issues in boot files 2021-09-03 15:46:23 -07:00
Steve Gravrock
6603ed7ddc Don't distribute boot src files
[#179017951]
2021-09-03 15:42:06 -07:00
Steve Gravrock
d61800c5c8 Removed support for custom promise libraries
All supported platforms now provide promises, so there's no longer a need
for Jasmine to be able to create them via a user-provided library. Jasmine
can still consume non-native promises but will always use the built-in
Promise object to create promises.

[#179078103]
2021-08-30 19:07:26 -07:00
Steve Gravrock
37b9f8e420 Removed Ruby support
[#179247162]
2021-08-30 18:53:13 -07:00
Steve Gravrock
a63b0b0368 Merge branch '3.99' into 4.0 2021-08-30 18:44:32 -07:00
Steve Gravrock
de9815f436 Merge branch 'main' into 3.99 2021-08-30 18:41:02 -07:00
Steve Gravrock
2fd9d7b13f Merge branch 'main' into 3.99 2021-08-17 17:08:34 -07:00
Steve Gravrock
4e96514634 Deprecated the Promise config setting
4.0 will only support environments that have native promises, so there will
no longer be a need for a user-supplied promise library
2021-08-07 12:04:14 -07:00
Steve Gravrock
d8862aa583 Removed the failFast and oneFailurePerSpec config properties 2021-07-31 09:28:14 -07:00
Steve Gravrock
2480a0a93a Merge branch '3.99' into 4.0 2021-07-31 09:15:12 -07:00
Steve Gravrock
9c9836c5b3 Don't use deprecated config prooperties in boot*.js 2021-07-31 09:09:46 -07:00
Steve Gravrock
20b914c554 Deprecated the failFast and oneFailurePerSpec config properties 2021-07-31 08:42:01 -07:00
Steve Gravrock
058e77b824 Merge branch 'main' into 3.99 2021-07-31 08:15:29 -07:00
Steve Gravrock
13dfcacbb0 Remove access to non-public properties of suites and specs returned by describe, it, etc.
[#179064612]
2021-07-30 17:36:50 -07:00
Steve Gravrock
6d002d22af Merge branch '3.99' into 4.0 2021-07-29 21:46:48 -07:00
Steve Gravrock
799d9897fd Deprecated access to non-public members in specs and suites returned from it(), describe(), etc. 2021-07-29 21:28:47 -07:00
Steve Gravrock
2a2a671b65 Don't deprecate access to Suite#id and Spec#id 2021-07-29 20:15:04 -07:00
Steve Gravrock
a0b4f3748d Merge branch 'main' into 3.99 2021-07-29 20:09:25 -07:00
Steve Gravrock
09d2ce9bc9 Removed more code that supported browsers we no longer run on 2021-07-27 17:53:09 -07:00
Steve Gravrock
e9bddc7a06 Removed obsolete timing function hacks from boot1.js 2021-07-26 19:04:43 -07:00
Steve Gravrock
310e4d5e6c Removed legacy boot.js file 2021-07-26 18:29:54 -07:00
Steve Gravrock
0424d4ae99 Removed Python support 2021-07-26 18:28:38 -07:00
Steve Gravrock
0720c88252 Merge branch '3.99' into 4.0 2021-07-26 18:20:24 -07:00
Steve Gravrock
f26b005807 Deprecated the legacy boot.js file 2021-07-26 18:20:07 -07:00
Steve Gravrock
1206952ca6 Merge branch 'main' into 3.99 2021-07-26 18:19:11 -07:00
Steve Gravrock
c73df57720 MatchersUtil#contains uses deep equality rather than === for set members
[#169001712]
2021-07-24 14:23:05 -07:00
Steve Gravrock
0170005015 Treat any argument to the done callback as an error
This reduces the risk of incorrectly passing a spec due to not correctly
detecting that an argument is an `Error` instance. Detecting Error instances
in a way that's reliable and portable across different browsers, TrustedTypes,
and frames is difficult.

[Finishes #178267587]
2021-07-24 09:30:39 -07:00
Steve Gravrock
6f04044417 Merge branch '3.99' into 4.0 2021-07-24 09:25:19 -07:00
Steve Gravrock
70d49e5b57 Deprecate non-Error arguments passed to done()
[Finishes #178267600]
2021-07-24 09:18:24 -07:00
Steve Gravrock
ed9363f477 Removed bower.json
Bower itself has been deprecated for four years, so we should drop support
for it in 4.0.

[Finishes #178512921]
2021-07-24 08:23:09 -07:00
Steve Gravrock
fe0a83ba87 Removed support for Internet Explorer 2021-07-23 21:46:15 -07:00
Steve Gravrock
623eecdcec Removed json2.js
Environments that don't provide a JSON parser are ancient history.
2021-07-22 21:37:57 -07:00
Steve Gravrock
a27280e9e7 Merge branch '3.99' into 4.0 2021-07-20 17:55:18 -07:00
Steve Gravrock
10601f5af6 Merge branch 'main' into 3.99 2021-07-20 17:47:17 -07:00
Steve Gravrock
c10ab4e704 Updated deprecation links 2021-07-20 16:50:31 -07:00
Steve Gravrock
e399953174 Removed obsolete timing function hacks from boot.js 2021-07-17 17:49:53 -07:00
Steve Gravrock
4edac7d3d1 Dropped Safari <13 from test matrix 2021-07-10 09:21:41 -07:00
Steve Gravrock
9b3d4a2bf2 Merge branch '3.99' into 4.0 2021-07-10 09:13:28 -07:00
Steve Gravrock
17826cd044 Fixed deprecations in matchersUtilSpec 2021-07-10 09:11:10 -07:00
Steve Gravrock
6cb9507f62 Merge branch 'main' into 3.99 2021-07-10 08:58:14 -07:00
Steve Gravrock
a0f6b77c3e Remove access to non-public Suite and Spec members via Env#topSuite 2021-05-29 18:57:56 -07:00
Steve Gravrock
3f3fb38cf1 Merge branch '3.99' into 4.0 2021-05-29 18:42:31 -07:00
Steve Gravrock
00c1e3d608 Deprecate access to non-public Suite and Spec members via Env#topSuite
The deprecation warning relies on Proxy, and won't work in environments
that don't have it. Among Jasmine's supported environments, that's Safari 9,
Safari 8, and all versions of IE.
2021-05-29 15:45:10 -07:00
Steve Gravrock
6a2a30d540 Improved & unified deprecation handling
* De-duplication now happens in core, not in reporters. This ensures that
  the console doesn't get flooded.
* Stack traces are opt-out, not opt-in.
* The current runnable is not reported or logged for certain deprecations
  where it's irrelevant.
* HtmlReporter shows stack traces in expandable widgets.
* Env#deprecated and Env#deprecatedOnceWithStack are merged.
2021-05-29 15:39:28 -07:00
Steve Gravrock
e4e232864d Don't expose Suite objects as this of describe functions
This was a holdover from 1.x that should have been removed in 2.0,
but was missed. Suite is meant to be private, and almost none of
its methods can be safely called by user code.
2021-05-22 09:15:22 -07:00
Steve Gravrock
5acddcda4a Merge branch '3.99' into 4.0 2021-05-22 09:09:03 -07:00
Steve Gravrock
61fb353197 Deprecate access to Suite objects via this in describes
Jasmine 1.x exposed Suite objects to user code as the `this` in describe
functions. That should have been removed in 2.0 but it was missed. It
will be removed in 4.0. This change adds a deprecation warning if anything
on a describe's `this` is accessed.

The deprecation warning relies on Proxy, and won't work in environments
that don't have it. Among Jasmine's supported environments, that's Safari 9,
Safari 8, and all versions of IE. In those browsers, a describe's `this`
will still be a Suite for now, but there will be no deprecation warnings.
2021-05-22 09:07:31 -07:00
Steve Gravrock
752441a66f Merge branch '3.99' into 4.0 2021-05-18 17:12:29 -07:00
Steve Gravrock
3e2872a1df Merge branch 'main' into 3.99 2021-05-18 17:07:34 -07:00
Steve Gravrock
1b97795684 Merge branch '3.99' into 4.0 2021-04-23 08:41:12 -07:00
Steve Gravrock
5504965bea Merge branch 'main' into 3.99 2021-04-23 08:40:25 -07:00
Steve Gravrock
c2a714f168 Removed support for IE 10 and Safari 8 2021-04-23 08:14:19 -07:00
Steve Gravrock
c2b558a2da Fail specs that try to combine two forms of async 2021-04-22 22:44:37 -07:00
Steve Gravrock
235efe52f1 Fixed test failure in IE 2021-04-22 22:43:48 -07:00
Steve Gravrock
1e8619df88 Removed deprecated env methods 2021-04-22 22:38:08 -07:00
Steve Gravrock
4b2a14f1f3 Removed deprecated custom matcher, matchersUtil, pp, etc interfaces 2021-04-22 22:29:20 -07:00
Steve Gravrock
66189d742b Merge branch 'no-children' of https://github.com/johnjbarton/jasmine into 4.0
* Merges #1742 from @johnjbarton
2021-04-22 21:35:58 -07:00
Steve Gravrock
fb05da1fc3 Merge branch 'main' into 3.99 2021-04-22 17:23:08 -07:00
Steve Gravrock
8b3a6561b1 Merge branch 'main' into 3.99 2021-04-02 11:35:30 -07:00
leoni laetitia
3234d475cd expect...toEqual check for Symbols 2021-01-31 22:32:58 +01:00
Steve Gravrock
7a38db2e32 Fixed deprecations triggered from within asymmetricEqualityTesterArgCompatShim 2020-09-17 13:26:35 -07:00
Steve Gravrock
a1f1b4ae0f Merge branch 'main' into 3.99 2020-09-14 18:39:32 -07:00
Steve Gravrock
c39c110eca Deprecate describes with no children 2020-02-12 16:44:44 -08:00
Steve Gravrock
18b2646d1d Allow libraries to avoid "Passing custom equality testers to MatchersUtil#contains is deprecated" while remaining compatible with older jasmine versions
Previously, a custom matcher library that wanted to remain compatible with
Jasmine <= 3.5.x could not know whether or not Jasmine expected it to pass
custom equality testers to MatchersUtil#contains. Passing them would produce
a deprecation warning in newer versions and not passing them would break
compatibility with older versions. Now we use matcher factory arity to
determine whether to pass custom equality testers to the factory, which
allows libraries to do something like this:

function matcherFactory(util) {
   const customEqualityTesters = arguments[1];
   // customEqualityTesters will be undefined in newer versions of Jasmine
   // and defined in older versions that expect it to be passed back to
   // MatchersUtil#equals.
}
2020-02-12 15:24:43 -08:00
Steve Gravrock
9aed55bb91 Improved readability of matcher-related deprecations
* Include stack traces. This makes it easier to find the matcher that
needs to be updated, particularly when it comes from a library rather
than the user's own code.

* Show each deprecation only once unless `config.verboseDeprecations`
is set. Since matchers are often added in a global `beforeEach`, logging
deprecations every time can be overwhelming.
2020-02-12 15:24:43 -08:00
Steve Gravrock
90d6f9d73c Added deprecation messages to interfaces that will be removed in 4.0
* `jasmine.pp`
* `jasmine.matchersUtil`
* Matchers that expect to receive custom equality testers
* Passing custom equality testers to `matchersUtil.contains`
* Passing custom equality testers to `matchersUtil.equals`
2020-02-12 15:24:42 -08:00
johnjbarton
2369c8dba7 fix(env): Throw if nested describe has no children.
Users would like an error if it() is acciddently moved within a before/afterEach/All function.
The it() function calls ensureIsNotNested to report such an error. But if the user has no
other it() functions in the Suite, it() and thus ensureIsNotNested() is never called.

Here we check nested Suites for children; if none are found we throw.
2019-08-07 18:01:34 -07:00
3408 changed files with 1221335 additions and 23041 deletions

View File

@@ -1,27 +1,23 @@
# Run tests against supported Node versions, and (except for pull requests)
# against supported browsers.
# against supported browsers that are available on Saucelabs.
version: 2.1
orbs:
node: circleci/node@3.0.0
win: circleci/windows@5.0.0
executors:
node16:
node24:
docker:
- image: cimg/node:16.1.0-browsers
- image: cimg/node:24.0.0
working_directory: ~/workspace
node14:
node22:
docker:
- image: circleci/node:14
- image: cimg/node:22.0.0
working_directory: ~/workspace
node12:
node20:
docker:
- image: circleci/node:12
working_directory: ~/workspace
node10:
docker:
- image: circleci/node:10
- image: cimg/node:20.0.0
working_directory: ~/workspace
jobs:
@@ -54,26 +50,66 @@ jobs:
steps:
- attach_workspace:
at: .
- run:
name: Report Node and NPM versions
command: echo "Using Node $(node --version) and NPM $(npm --version)"
- run:
name: Run tests
command: npm test
test_win:
executor:
name: win/default
shell: bash.exe
steps:
- checkout
- run:
name: Install Node.js
command: nvm install 20.0.0 && nvm use 20.0.0
- run:
name: Report Node and NPM versions
command: echo "Using Node $(node --version) and NPM $(npm --version)"
- run:
name: Install dependencies
command: npm install
- run:
name: Build
command: npm run build
- run:
name: Run tests
command: npm test
test_parallel: &test_parallel
parameters:
executor:
type: executor
executor: << parameters.executor >>
steps:
- attach_workspace:
at: .
- run:
name: Report Node and NPM versions
command: echo "Using Node $(node --version) and NPM $(npm --version)"
- run:
name: Run tests in parallel
command: npm run test:parallel
test_browsers: &test_browsers
executor: node14
environment:
SKIP_JASMINE_BROWSER_FLAKES: "true"
executor: node20
steps:
- attach_workspace:
at: .
- run:
name: Install Sauce Connect
command: |
cd /tmp
curl https://saucelabs.com/downloads/sc-4.6.4-linux.tar.gz | tar zxf -
chmod +x sc-4.6.4-linux/bin/sc
tmpdir=$(mktemp -d)
cd "$tmpdir"
curl https://saucelabs.com/downloads/sauce-connect/5.2.2/sauce-connect-5.2.2_linux.x86_64.tar.gz | tar zxf -
chmod +x sc
mkdir ~/workspace/bin
cp sc-4.6.4-linux/bin/sc ~/workspace/bin
~/workspace/bin/sc --version
cp sc ~/workspace/bin
echo "Sauce Connect version info:"
~/workspace/bin/sc version
- run:
name: Run tests
command: |
@@ -81,125 +117,40 @@ jobs:
# cleanly if we kill it from a different step than it started in.
export PATH=$PATH:$HOME/workspace/bin
export SAUCE_TUNNEL_IDENTIFIER=$CIRCLE_BUILD_NUM
scripts/start-sauce-connect sauce-pidfile
export SAUCE_TUNNEL_NAME=$CIRCLE_WORKFLOW_JOB_ID
scripts/start-sauce-connect
set +o errexit
scripts/run-all-browsers
scripts/run-sauce-browsers
exitcode=$?
set -o errexit
scripts/stop-sauce-connect $(cat sauce-pidfile)
scripts/stop-sauce-connect
exit $exitcode
test_browser_flakes:
<<: *test_browsers
environment:
SKIP_JASMINE_BROWSER_FLAKES: "false"
workflows:
version: 2
cron:
triggers:
- schedule:
# Times are UTC.
cron: "0 11 * * *"
filters:
branches:
only:
- main
- "3.99"
- "4.0"
jobs:
- build:
executor: node16
name: build_node_16
- build:
executor: node14
name: build_node_14
- build:
executor: node12
name: build_node_12
- build:
executor: node10
name: build_node_10
- test_node:
executor: node16
name: test_node_16
requires:
- build_node_16
- test_node:
executor: node12
name: test_node_12
requires:
- build_node_12
- test_node:
executor: node10
name: test_node_10
requires:
- build_node_10
- test_browsers:
requires:
- build_node_14
filters:
branches:
ignore: /pull\/.*/ # Don't run on pull requests.
push:
jobs:
- build:
executor: node16
name: build_node_16
- build:
executor: node14
name: build_node_14
- build:
executor: node12
name: build_node_12
- build:
executor: node10
name: build_node_10
matrix:
parameters:
executor: [node20, node22, node24]
- test_node:
executor: node16
name: test_node_16
matrix:
parameters:
executor: [node20, node22, node24]
requires:
- build_node_16
- test_node:
executor: node14
name: test_node_14
- build-<< matrix.executor >>
- test_parallel:
matrix:
parameters:
executor: [node20, node22, node24]
requires:
- build_node_14
- test_node:
executor: node12
name: test_node_12
requires:
- build_node_12
- test_node:
executor: node10
name: test_node_10
requires:
- build_node_10
- build-<< matrix.executor >>
- test_browsers:
requires:
- build_node_14
- build-node20
filters:
branches:
ignore: /pull\/.*/ # Don't run on pull requests.
browser-flakes:
triggers:
- schedule:
# Times are UTC.
cron: "0 10 * * *"
filters:
branches:
only:
- browser-flakes
jobs:
- build:
executor: node14
name: build_node_14
- test_browser_flakes:
requires:
- build_node_14
filters:
branches:
ignore: /pull\/.*/ # Don't run on pull requests.
- test_win

View File

@@ -3,14 +3,6 @@ charset = utf-8
end_of_line = lf
insert_final_newline = true
[*.{js, json, sh, yml, gemspec}]
[*.{js,mjs,json,sh,yml}]
indent_style = space
indent_size = 2
[{Rakefile, .jshintrc}]
indent_style = space
indent_size = 2
[*.{py}]
indent_style = space
indent_size = 4

7
.gitattributes vendored
View File

@@ -1,2 +1,7 @@
* text=auto eol=lf
*.png -text
*.png filter=lfs diff=lfs merge=lfs -text
*.mp4 filter=lfs diff=lfs merge=lfs -text
*.mov filter=lfs diff=lfs merge=lfs -text
*.jpg filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.docx filter=lfs diff=lfs merge=lfs -text

View File

@@ -1,35 +1,25 @@
# Developing for Jasmine Core
# Contributing to Jasmine
We welcome your contributions! Thanks for helping make Jasmine a better project
for everyone. Please review the backlog and discussion lists before starting
work. What you're looking for may already have been done. If it hasn't, the
community can help make your contribution better. If you want to contribute but
don't know what to work on,
[issues tagged help needed](https://github.com/jasmine/jasmine/labels/help%20needed)
for everyone. If you want to contribute but don't know what to work on,
[issues tagged help needed](https://github.com/issues?q=is%3Aopen+is%3Aissue+org%3Ajasmine+label%3A%22help+needed%22+)
should have enough detail to get started.
## Links
## Before Submitting a Pull Request
- [Jasmine Google Group](http://groups.google.com/group/jasmine-js)
- [Jasmine-dev Google Group](http://groups.google.com/group/jasmine-js-dev)
- [Jasmine on PivotalTracker](https://www.pivotaltracker.com/n/projects/10606)
1. Ensure all specs are green in browsers *and* node.
* Use `npm test` to test in Node.
* Use `npm run serve` to test in browsers.
2. Fix any eslint or prettier errors reported at the end of `npm test`. Prettier
errors can be automatically fixed by running `npm run cleanup`.
3. Build `jasmine.js` with `npm run build` and run all specs again. This
ensures that your changes self-test well.
5. Revert your changes to `jasmine.js` and `jasmine-html.js`. When we accept
your pull request, we will generate these files as a separate commit and
merge the entire branch into master.
## General Workflow
Please submit pull requests via feature branches using the semi-standard workflow of:
```bash
git clone git@github.com:yourUserName/jasmine.git # Clone your fork
cd jasmine # Change directory
git remote add upstream https://github.com/jasmine/jasmine.git # Assign original repository to a remote named 'upstream'
git fetch upstream # Fetch changes not present in your local repository
git merge upstream/main # Sync local main with upstream repository
git checkout -b my-new-feature # Create your feature branch
git commit -am 'Add some feature' # Commit your changes
git push origin my-new-feature # Push to the branch
```
Once you've pushed a feature branch to your forked repo, you're ready to open a pull request. We favor pull requests with very small, single commits with a single purpose.
We only accept green pull requests. If you see that the CI build failed, please
fix it. Feel free to ask for help if you're stuck.
## Background
@@ -38,15 +28,16 @@ Once you've pushed a feature branch to your forked repo, you're ready to open a
* `/src` contains all of the source files
* `/src/core` - generic source files
* `/src/html` - browser-specific files
* `/src/boot` - sources for boot files (see below)
* `/spec` contains all of the tests
* mirrors the source directory
* there are some additional files
* `/lib` contains the compiled copy of Jasmine. This is used to self-test and
distributed as the `jasmine-core` Node, Ruby, and Python packages.
distributed as the `jasmine-core` Node, and Ruby packages.
### Self-testing
Note that Jasmine tests itself. The files in `lib` are loaded first, defining the reference `jasmine`. Then the files in `src` are loaded, defining the reference `jasmineUnderTest`. So there are two copies of the code loaded under test.
Jasmine tests itself. The files in `lib` are loaded first, defining the reference `jasmine`. Then the files in `src` are loaded, defining the reference `jasmineUnderTest`. So there are two copies of the code loaded under test.
The tests should always use `jasmineUnderTest` to refer to the objects and functions that are being tested. But the tests can use functions on `jasmine` as needed. _Be careful how you structure any new test code_. Copy the patterns you see in the existing code - this ensures that the code you're testing is not leaking into the `jasmine` reference and vice-versa.
@@ -60,9 +51,8 @@ is appropriate for browsers, projects may wish to customize this file.
### Compatibility
Jasmine runs in both Node and browsers, including some older browsers that do
not support the latest JavaScript features. See the README for the list of
currently supported environments.
Jasmine runs in both Node and a variety of browsers. See the README for the
list of currently supported environments.
## Development
@@ -88,51 +78,35 @@ Or, How to make a successful pull request
* _Do not change the public interface_. Lots of projects depend on Jasmine and
if you aren't careful you'll break them.
* _Be environment agnostic_ - server-side developers are just as important as
browser developers.
* _Be environment agnostic_. Some people run their specs in browsers, others in
Node. Jasmine should support them all as much as possible.
* _Be browser agnostic_ - if you must rely on browser-specific functionality,
please write it in a way that degrades gracefully.
* _Write specs_ - Jasmine's a testing framework. Don't add functionality
without test-driving it.
* _Write code in the style of the rest of the repo_ - Jasmine should look like
a cohesive whole.
a cohesive whole.
* _Ensure the *entire* test suite is green_ in all the big browsers, Node, and
ESLint. Your contribution shouldn't break Jasmine for other users.
ESLint/Prettier. Your contribution shouldn't break Jasmine for other users.
Follow these tips and your pull request, patch, or suggestion is much more likely to be integrated.
### Running Specs
Be sure to run the tests in at least one supported Node version and at least a
couple of supported browsers. It's also a good idea to run the tests in Internet
Explorer if you've touched code in `src/html`, if your change involves newer
JavaScript language/runtime features, or if you're unfamiliar with writing code
for older browsers. To run the tests in Node, simply use `npm test` as described
above. To run the tests in a browser, run `npm run serve` and then visit
`http://localhost:8888`.
couple of supported browsers. To run the tests in Node, simply use `npm test`
as described above. To run the tests in a browser, run `npm run serve` and then
visit `http://localhost:8888`.
If you have the necessary Selenium drivers installed, you can also use Jasmine's
CI tooling:
If you have the necessary Selenium drivers installed (e.g. geckodriver or
chromedriver), you can also use Jasmine's CI tooling:
$ JASMINE_BROWSER=<name of browser> node spec/support/ci.js
$ JASMINE_BROWSER=<name of browser> npm run ci
The easiest way to run the tests in **Internet Explorer** is to run a VM that has IE installed. It's easy to do this with VirtualBox.
1. Download and install [VirtualBox](https://www.virtualbox.org/wiki/Downloads).
1. Download a VM image [from Microsoft](https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/). Select "VirtualBox" as the platform.
1. Unzip the downloaded archive. There should be an OVA file inside.
1. In VirtualBox, choose `File > Import Appliance` and select the OVA file. Accept the default settings in the dialog that appears. Now you have a Windows VM!
1. Run the VM and start IE.
1. With `npm run serve` running on your host machine, navigate to `http://<your IP address>:8888` in IE.
## Before Committing or Submitting a Pull Request
1. Ensure all specs are green in browser *and* node.
1. Ensure eslint and prettier are clean as part of your `npm test` command. You can run `npm run cleanup` to have prettier re-write the files.
1. Build `jasmine.js` with `npm run build` and run all specs again - this ensures that your changes self-test well.
1. Revert your changes to `jasmine.js` and `jasmine-html.js`
* We do this because `jasmine.js` and `jasmine-html.js` are auto-generated (as you've seen in the previous steps) and accepting multiple pull requests when this auto-generated file changes causes lots of headaches
* When we accept your pull request, we will generate these files as a separate commit and merge the entire branch into main
Note that we use Circle CI for Continuous Integration. We only accept green pull requests.
### Submitting a Pull Requeset
Once you've done the steps listed under "Before Submitting a Pull Request"
above, you can submit a pull request via the
[standard GitHub process](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request).
TL;DR: Fork the repository, push your work up to your fork, and create a PR from
there.

View File

@@ -1,47 +0,0 @@
## Are you creating an issue in the correct repository?
- When in doubt, create an issue here.
- If you have an issue with the Jasmine docs, file an issue in the docs repo
here: https://github.com/jasmine/jasmine.github.io
- If you have an issue with TypeScript typings, start a discussion at
[DefinitelyTpyed](https://github.com/DefinitelyTyped/DefinitelyTyped/discussions/new?category=issues-with-a-types-package)
- This repository is for the core Jasmine framework
- If you are using a test runner that wraps Jasmine, consider filing an issue with that library if appropriate:
- [Jasmine npm](https://github.com/jasmine/jasmine-npm/issues)
- [Jasmine browser runner](https://github.com/jasmine/jasmine-browser/issues)
- [Jasmine gem](https://github.com/jasmine/jasmine-gem/issues)
- [Jasmine py](https://github.com/jasmine/jasmine-py/issues)
- [Gulp Jasmine Browser](https://github.com/jasmine/gulp-jasmine-browser/issues)
- [Karma](https://github.com/karma-runner/karma/issues)
- [Grunt Contrib Jasmine](https://github.com/gruntjs/grunt-contrib-jasmine/issues)
<!--- Provide a general summary of the issue in the Title above -->
## Expected Behavior
<!--- If you're describing a bug, tell us what should happen -->
<!--- If you're suggesting a change/improvement, tell us how it should work -->
## Current Behavior
<!--- If describing a bug, tell us what happens instead of the expected behavior -->
<!--- If suggesting a change/improvement, explain the difference from current behavior -->
## Possible Solution
<!--- Not obligatory, but suggest a fix/reason for the bug, -->
<!--- or ideas how to implement the addition or change -->
## Suite that reproduces the behavior (for bugs)
<!--- Provide a sample suite that reproduces the bug. -->
```javascript
describe("sample", function() {
});
```
## Context
<!--- How has this issue affected you? What are you trying to accomplish? -->
<!--- Providing context helps us come up with a solution that is most useful in the real world -->
## Your Environment
<!--- Include as many relevant details about the environment you experienced the bug in -->
* Version used:
* Environment name and version (e.g. Chrome 39, node.js 5.4):
* Operating System and version (desktop or mobile):
* Link to your project:

95
.github/ISSUE_TEMPLATE/bug_report.yml vendored Normal file
View File

@@ -0,0 +1,95 @@
name: Bug Report
description: I think I've found a bug in Jasmine
labels: ["bug report"]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to report a bug. Please follow these steps first.
## Troubleshooting
Please take the time to rule out issues with your code or third party libraries before filing a bug report. If you are reporting an error, try to determine whether the error is coming from Jasmine, another library, or your own code.
Check the [FAQ](https://jasmine.github.io/pages/faq.html) and any other relevant [documentation](https://jasmine.github.io/pages/docs_home.html) to see if your issue has already been addressed.
## Special troubleshooting steps for asynchronous scenarios
If the issue has to do with testing asynchronous code, please read the [async tutorial](https://jasmine.github.io/tutorials/async) and the [async section of the FAQ](https://jasmine.github.io/pages/faq.html#async). In particular, check for the following common errors:
* Are you trying to write a synchronous test for asynchronous code?
* Does the test signal completion before the code under test finishes?
* Do expectations run before the code that they're trying to verify?
## Try the latest version of Jasmine
If at all possible, upgrade to the latest versions of `jasmine-core` and any other relevant packages (e.g. `jasmine`, `jasmine-browser-runner`). If you can't do that, please check the [release notes](https://github.com/jasmine/jasmine/tree/main/release_notes) for all newer versions to make sure that the bug hasn't already been fixed.
## Explain how to reproduce the bug
**Working steps to reproduce are required for all bug reports.** Please help us help you by creating complete but minimal instructions for reproducing the bug.
The steps to reproduce could be:
* A code snippet that reproduces the problem when run by itself in a newly generated empty `jasmine` or `jasmine-browser-runner` project, or in the standalone distribution.
* A set of steps that reproduce the problem when followed exactly as they're written in an empty directory.
* A link to a Git repository or zip/tar file containing a [minimal, reproducible example](https://stackoverflow.com/help/minimal-reproducible-example). This option is required for all bugs that can only be reproduced with third-party libraries, including Angular and Karma.
Please **test your steps** by starting with an empty directory and following them exactly as they're written. Bug reports with steps to reproduce that are unclear, don't work, or include an unreasonable amount of extraneous code will likely be closed.
- type: textarea
id: steps-to-reproduce
attributes:
label: Steps to Reproduce
validations:
required: true
- type: textarea
id: expected-behavior
attributes:
label: Expected Behavior
description: What do you think should have happened?
validations:
required: true
- type: textarea
id: actual-behavior
attributes:
label: Actual Behavior
description: What happened instead?
validations:
required: true
- type: textarea
id: possible-solution
attributes:
label: Possible Solution
description: This is optional, but if you have an idea for how to fix the bug we'd like to hear it.
- type: textarea
id: context
attributes:
label: Context
description: How has this issue affected you? What are you trying to accomplish? By providing context, you can help us come up with a solution that is most useful in the real world.
- type: input
id: jasmine-core-version
attributes:
label: jasmine-core version
validations:
required: true
- type: textarea
id: other-versions
attributes:
label: Versions of other relevant packages
placeholder: |
jasmine-browser-runner 1.2.0
fancy-reporter 132.4.8
- type: input
id: browser-or-node-version
attributes:
label: Node.js and/or browser version
placeholder: E.g. "node 16.2.0" or "Safari 15"
validations:
required: true
- type: input
id: os
attributes:
label: Operating System
placeholder: E.g. "Windows 10", "MacOS 12.5", "MCC Interim Linux 0.99.p8"
validations:
required: true

17
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@@ -0,0 +1,17 @@
blank_issues_enabled: false
contact_links:
- name: Questions, requests for help, etc
url: https://github.com/jasmine/jasmine/discussions/new/choose
about: Please start a discussion.
- name: Issues with the `jasmine` CLI
url: https://github.com/jasmine/jasmine-npm/issues
about: Please create issues related to the `jasmine` package in its repository.
- name: Issues with jasmine-browser-runner
url: https://github.com/jasmine/jasmine-browser-runner/issues
about: Please create issues related to the `jasmine-browser-runner` package in its repository.
- name: Documentation issues
url: https://github.com/jasmine/jasmine.github.io/issues
about: Please create documentation issues in the docs repository.
- name: TypeScript issues
url: https://github.com/DefinitelyTyped/DefinitelyTyped/discussions
about: Please create issues related to TypeScript compilation errors or other problems with type definitions at DefinitelyTyped.

View File

@@ -0,0 +1,31 @@
name: Feature Proposal
description: I'd like to propose a new feature
labels: ["feature request"]
body:
- type: markdown
attributes:
value: Thanks for taking the time to propose a new feature. Although Jasmine is mostly feature complete, we're always open to hearing new ideas.
- type: textarea
id: description
attributes:
label: Feature Proposal
validations:
required: true
- type: textarea
id: context
attributes:
label: Context
description: How would this feature be useful to you? What are you trying to accomplish? By providing context, you can help us come up with a solution that is most useful in the real world.
validations:
required: true
- type: textarea
id: example
attributes:
label: Example
description: If you're proposing a new API or something similar, please show an example of how it would be used.
render: JavaScript
- type: textarea
id: other-info
attributes:
label: Other Information
description: Anything else that you think would be helpful.

View File

@@ -24,7 +24,7 @@
- [ ] My code follows the code style of this project.
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [ ] I have read the **CONTRIBUTING** document.
- [ ] I have read the [**CONTRIBUTING**](https://github.com/jasmine/jasmine/blob/main/.github/CONTRIBUTING.md) guide.
- [ ] I have added tests to cover my changes.
- [ ] All new and existing tests passed.

23
.github/workflows/safari.yml vendored Normal file
View File

@@ -0,0 +1,23 @@
name: Test in latest available Safari
on:
push:
pull_request:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
jobs:
build:
runs-on: macos-latest
steps:
- name: Report Safari version
run: osascript -e 'get version of application "Safari"'
- uses: actions/checkout@v4
- name: Use Node.js 22.x
uses: actions/setup-node@v4
with:
node-version: 22.x
- run: npm install
- run: npm run build
- run: JASMINE_BROWSER=safari npm run ci

2
.gitignore vendored
View File

@@ -17,11 +17,9 @@ pkg/*
.sass-cache/*
src/html/.sass-cache/*
node_modules/
*.pyc
sauce_connect.log
*.swp
build/
*.egg-info/
dist
nbproject/
*.iml

3
.prettierrc Normal file
View File

@@ -0,0 +1,3 @@
{
"singleQuote": true
}

1
.rspec
View File

@@ -1 +0,0 @@
--color

BIN
2026羅安禾作品整理.docx LFS Normal file

Binary file not shown.

BIN
2026羅安禾作品整理.old.docx LFS Executable file

Binary file not shown.

BIN
2026羅安禾作品整理.pdf LFS Normal file

Binary file not shown.

48
AGENTS.md Normal file
View File

@@ -0,0 +1,48 @@
# Jasmine Core Development Notes
## Architecture
- This is the main jasmine-core repository, a JavaScript BDD testing framework
- **Directory structure**:
- `src/` - source code
- `src/core/` - environment-agnostic core functionality
- `src/html/` - browser-specific code
- `src/boot/` - boot files for browser setup
- `spec/` - tests, mirrors the src directory structure
- `lib/` - compiled distribution files (built, not checked in modified)
## Key Development Commands
- `npm install` - install dependencies
- `npm test` - run all tests in Node.js + lint + prettier check
- `npm run test:parallel` - run tests in parallel
- `npm run build` - build distribution to `/lib`
- `npm run cleanup` - auto-fix prettier errors
- `npm run serve` - serve tests for browser testing at http://localhost:8888
- `JASMINE_BROWSER=<name> npm run ci` - run browser tests via Selenium
## Before submitting PR
1. Run tests in Node.js AND browsers: `npm test` and `npm run serve`
2. Fix any eslint/prettier errors: `npm run cleanup`
3. Build `lib/` with `npm run build` and re-test
4. Revert changes to built files in `lib/` - maintainers will rebuild when merging
## Testing Conventions
- Jasmine self-tests: `lib/jasmine-core.js` provides `jasmine` (runner), `src/` provides `jasmineUnderTest` (code under test)
- Always use `jasmineUnderTest` for objects/functions being tested
## Coding Conventions
- Single quotes, semicolons required
- Curly braces required for all control statements
- ECMA 2022 syntax, commonjs modules
- Core code must stay environment-agnostic:
- Keep browser-specific code in `src/html/`
- Degrade gracefully when environment-specific features aren't available
## Supported Environments
- Node: 20, 22, 24
- Browsers: Safari 26+, Chrome/Firefox/Edge (evergreen)

View File

@@ -1,2 +0,0 @@
source 'https://rubygems.org'
gemspec

View File

@@ -1,57 +0,0 @@
module.exports = function(grunt) {
var pkg = require("./package.json");
global.jasmineVersion = pkg.version;
grunt.initConfig({
pkg: pkg,
concat: require('./grunt/config/concat.js'),
sass: require('./grunt/config/sass.js'),
compress: require('./grunt/config/compress.js'),
cssUrlEmbed: require('./grunt/config/cssUrlEmbed.js')
});
require('load-grunt-tasks')(grunt);
grunt.loadTasks('grunt/tasks');
grunt.registerTask('default', ['sass:dist', "cssUrlEmbed"]);
var version = require('./grunt/tasks/version.js');
grunt.registerTask('build:copyVersionToGem',
"Propagates the version from package.json to version.rb",
version.copyToGem);
grunt.registerTask('buildDistribution',
'Builds and lints jasmine.js, jasmine-html.js, jasmine.css',
[
'sass:dist',
"cssUrlEmbed",
'concat'
]
);
grunt.registerTask("execSpecsInNode",
"Run Jasmine core specs in Node.js",
function() {
var done = this.async(),
Jasmine = require('jasmine'),
jasmineCore = require('./lib/jasmine-core.js'),
jasmine = new Jasmine({jasmineCore: jasmineCore});
jasmine.loadConfigFile('./spec/support/jasmine.json');
jasmine.onComplete(function(passed) {
done(passed);
});
jasmine.execute();
}
);
grunt.registerTask("execSpecsInNode:performance",
"Run Jasmine performance specs in Node.js",
function() {
require("shelljs").exec("node_modules/.bin/jasmine JASMINE_CONFIG_PATH=spec/support/jasmine-performance.json");
}
);
};

View File

@@ -1,4 +1,5 @@
Copyright (c) 2008-2019 Pivotal Labs
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 +0,0 @@
recursive-include . *.py
prune node_modules
include lib/jasmine-core/*.js
include lib/jasmine-core/*.css
include images/*.png
include package.json

View File

@@ -1,15 +1,10 @@
<a name="README">[<img src="https://rawgithub.com/jasmine/jasmine/main/images/jasmine-horizontal.svg" width="400px" />](http://jasmine.github.io)</a>
[![Build Status](https://circleci.com/gh/jasmine/jasmine.svg?style=shield)](https://circleci.com/gh/jasmine/jasmine)
[![Open Source Helpers](https://www.codetriage.com/jasmine/jasmine/badges/users.svg)](https://www.codetriage.com/jasmine/jasmine)
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fjasmine%2Fjasmine.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fjasmine%2Fjasmine?ref=badge_shield)
<a name="README"><img src="https://raw.githubusercontent.com/jasmine/jasmine/main/images/jasmine-horizontal.svg" width="400px" alt="Jasmine"></a>
# A JavaScript Testing Framework
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.
Documentation & guides live here: [http://jasmine.github.io](http://jasmine.github.io/)
For a quick start guide of Jasmine, see the beginning of [http://jasmine.github.io/edge/introduction.html](http://jasmine.github.io/edge/introduction.html).
Upgrading from Jasmine 4.x? Check out the [upgrade guide](https://jasmine.github.io/tutorials/upgrading_to_Jasmine_5.0).
## Contributing
@@ -17,73 +12,53 @@ Please read the [contributors' guide](https://github.com/jasmine/jasmine/blob/ma
## Installation
For the Jasmine NPM module:<br>
[https://github.com/jasmine/jasmine-npm](https://github.com/jasmine/jasmine-npm).
There are several different ways to install Jasmine, depending on your
environment and how you'd like to use it. See the [Getting Started page](https://jasmine.github.io/pages/getting_started.html)
for details.
For the Jasmine browser runner:<br>
[https://github.com/jasmine/jasmine-browser](https://github.com/jasmine/jasmine-browser).
## Usage
For the Jasmine Ruby Gem:<br>
[https://github.com/jasmine/jasmine-gem](https://github.com/jasmine/jasmine-gem).
To install Jasmine standalone on your local box (where **_{#.#.#}_** below is substituted by the release number downloaded):
* Download the standalone distribution for your desired release from the [releases page](https://github.com/jasmine/jasmine/releases).
* Create a Jasmine directory in your project. - `mkdir my-project/jasmine`
* Move the dist to your project directory. - `mv jasmine/dist/jasmine-standalone-{#.#.#}.zip my-project/jasmine`
* Change directory. - `cd my-project/jasmine`
* Unzip the dist. - `unzip jasmine-standalone-{#.#.#}.zip`
Add the following to your HTML file:
```html
<link rel="shortcut icon" type="image/png" href="lib/jasmine-{#.#.#}/jasmine_favicon.png">
<link rel="stylesheet" type="text/css" href="lib/jasmine-{#.#.#}/jasmine.css">
<script type="text/javascript" src="lib/jasmine-{#.#.#}/jasmine.js"></script>
<script type="text/javascript" src="lib/jasmine-{#.#.#}/jasmine-html.js"></script>
<script type="text/javascript" src="lib/jasmine-{#.#.#}/boot.js"></script>
```
See the [documentation site](https://jasmine.github.io/pages/docs_home.html),
particularly the [Your First Suite tutorial](https://jasmine.github.io/tutorials/your_first_suite)
for information on writing specs, and [the FAQ](https://jasmine.github.io/pages/faq.html).
## Supported environments
Jasmine tests itself across many browsers (Safari, Chrome, Firefox, Microsoft Edge, and Internet Explorer) as well as nodejs.
Jasmine tests itself across popular browsers (Safari, Chrome, Firefox, and
Microsoft Edge) as well as Node.
| Environment | Supported versions |
|-------------------|--------------------|
| Node | 10, 12, 14, 16 |
| Safari | 8-14 |
| Chrome | Evergreen |
| Firefox | Evergreen, 68, 78 |
| Edge | Evergreen |
| Internet Explorer | 10, 11 |
| Environment | Supported versions |
|-------------------|----------------------------------|
| Node | 20, 22, 24 |
| Safari | 26* |
| Chrome | Evergreen |
| Firefox | Evergreen, 140 |
| Edge | Evergreen |
For evergreen browsers, each version of Jasmine is tested against the version of the browser that is available to us
at the time of release. Other browsers, as well as older & newer versions of some supported browsers, are likely to work.
However, Jasmine isn't tested against them and they aren't actively supported.
## Support
\* 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.
* Search past discussions: [http://groups.google.com/group/jasmine-js](http://groups.google.com/group/jasmine-js).
* Send an email to the list: [jasmine-js@googlegroups.com](mailto:jasmine-js@googlegroups.com).
* View the project backlog at Pivotal Tracker: [http://www.pivotaltracker.com/projects/10606](http://www.pivotaltracker.com/projects/10606).
* Follow us on Twitter: [@JasmineBDD](http://twitter.com/JasmineBDD).
To find out what environments work with a particular Jasmine release, see the [release notes](https://github.com/jasmine/jasmine/tree/main/release_notes).
## Maintainers
* [Gregg Van Hove](mailto:gvanhove@pivotal.io), Pivotal Labs
* [Gwendolyn Van Hove](mailto:gwen@slackersoft.net)
* [Steve Gravrock](mailto:sdg@panix.com)
### Maintainers Emeritus
* [Davis W. Frank](mailto:dwfrank@pivotal.io), Pivotal Labs
* [Rajan Agaskar](mailto:rajan@pivotal.io), Pivotal Labs
* [Greg Cobb](mailto:gcobb@pivotal.io), Pivotal Labs
* [Chris Amavisca](mailto:camavisca@pivotal.io), Pivotal Labs
* [Christian Williams](mailto:antixian666@gmail.com), Cloud Foundry
* [Davis W. Frank](mailto:dwfrank@pivotal.io)
* [Rajan Agaskar](mailto:rajan@pivotal.io)
* [Greg Cobb](mailto:gcobb@pivotal.io)
* [Chris Amavisca](mailto:camavisca@pivotal.io)
* [Christian Williams](mailto:antixian666@gmail.com)
* Sheel Choksi
Copyright (c) 2008-2018 Pivotal Labs. This software is licensed under the MIT License.
## License
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fjasmine%2Fjasmine.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fjasmine%2Fjasmine?ref=badge_large)
Copyright (c) 2008-2019 Pivotal Labs<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

@@ -13,89 +13,64 @@ Please attempt to keep commits to `main` small, but cohesive. If a feature is co
We attempt to stick to [Semantic Versioning](http://semver.org/). Most of the time, development should be against a new minor version - fixing bugs and adding new features that are backwards compatible.
The current version lives in the file `/package.json`. This version will be the version number that is currently released. When releasing a new version, update `package.json` with the new version and `grunt build:copyVersionToGem` to update the gem version number.
The current version lives in the file `/package.json`. This version will be
copied to `jasmine.js` when the distribution is built. When releasing a new
version, update `package.json` with the new version and `npm run build` to
update the gem version number.
This version is used by both `jasmine.js` and the `jasmine-core` Ruby gem.
Note that Jasmine should only use the "patch" version number if the new release
contains only bug fixes.
Note that Jasmine should only use the "patch" version number in the following cases:
* Changes related to packaging for a specific platform (npm, gem, or pip).
* Fixes for regressions.
When jasmine-core revs its major or minor version, the binding libraries should also rev to that version.
When `jasmine-core` revs its major or minor version, the `jasmine` NPM package
should also rev to that version.
## Release
When ready to release - specs are all green and the stories are done:
1. Update the release notes in `release_notes` - use the Anchorman gem to generate the markdown file and edit accordingly. Include a list of supported environments.
1. Update the version in `package.json`
1. Run `npm run build`.
1. Copy version to the Ruby gem with `grunt build:copyVersionToGem`
1. Update the release notes in `release_notes` - use the Anchorman gem to
generate the Markdown file and edit accordingly. Include a list of supported
environments. Get that information from these places:
* For Node, see .circleci/config.yml or the README.
* For Firefox ESR and Safari <=17, see scripts/run-sauce-browsers or the README.
* For evergreen browsers, trigger a Circle CI run and check the
[Saucelabs dashboard](https://app.saucelabs.com/dashboard/tests?ownerId=90a771d55857492da3bd5251a2d92457&ownerType=user&ownerName=jasmine-js&start=last7days)
once it's finished.
* For Safari >17, trigger the [Safari action](https://github.com/jasmine/jasmine/actions/workflows/safari.yml)
and get the version from the output.
2. Update the version in `package.json`
3. Run `npm run build`.
### Commit and push core changes
1. Run the browser tests using `scripts/run-all-browsers`.
1. Commit release notes and version changes (jasmine.js, version.rb, package.json)
1. Push
1. Wait for Circle CI to go green
1. Commit release notes and version changes (jasmine.js, package.json)
2. Push
3. Tag the release and push the tag.
4. Wait for Circle CI to go green
### Build standalone distribution
1. Build the standalone distribution with `grunt buildStandaloneDist`
1. Build the standalone distribution with `npm run buildStandaloneDist`
1. This will generate `dist/jasmine-standalone-<version>.zip`, which you will upload later (see "Finally" below).
### Release the core Ruby gem
1. __NOTE__: You will likely need to push a new jasmine gem with a dependent version right after this release. See below.
1. `rake release` - tags the repo with the version, builds the `jasmine-core` gem, pushes the gem to Rubygems.org. In order to release you will have to ensure you have rubygems creds locally.
### Release the core Python egg
Install [twine](https://github.com/pypa/twine)
1. `python setup.py sdist`
1. `twine upload dist/jasmine-core-<version>.tar.gz` You will need pypi credentials to upload the egg.
### Release the core NPM module
1. Run the tests on Windows. (CI only tests on Linux.)
1. `npm adduser` to save your credentials locally
1. `npm publish .` to publish what's in `package.json`
1. `npm login` to save your credentials locally
2. `npm publish .` to publish what's in `package.json`
### Release the docs
Probably only need to do this when releasing a minor version, and not a patch version.
Probably only need to do this when releasing a minor version, and not a patch
version. See [the README file in the docs repo](https://github.com/jasmine/jasmine.github.io/blob/master/README.md)
for instructions.
1. `rake update_edge_jasmine`
1. `npm run jsdoc`
1. `rake release[${version}]` to copy the current edge docs to the new version
1. Commit and push.
### Release the `jasmine` NPM package
### Release the binding libraries
See <https://github.com/jasmine/jasmine-npm/blob/main/RELEASE.md>.
#### NPM
### Publish the GitHub release
1. Create release notes using Anchorman as above
1. In `package.json`, update both the package version and the jasmine-core dependency version
1. Commit and push.
1. Wait for Circle CI to go green again.
1. Run the tests on Windows locally.
1. `grunt release `. (Note: This will publish the package by running `npm publish`.)
#### Gem
1. Create release notes using Anchorman as above
1. Update the version number in `lib/jasmine/version.rb`.
1. Update the jasmine-core dependency version in `jasmine.gemspec`.
1. Commit and push.
1. Wait for Circle CI to go green again.
1. `rake release`
### Finally
For each of the above GitHub repos:
1. Visit the releases page and find the tag just published.
1. Paste in a link to the correct release notes for this release. The link should reference the blob and tag correctly, and the markdown file for the notes.
1. If it is a pre-release, mark it as such.
1. For core, attach the standalone zipfile.
2. Paste in a link to the correct release notes for this release.
3. If it is a pre-release, mark it as such.
4. Attach the standalone zipfile.

View File

@@ -1,2 +0,0 @@
require "bundler"
Bundler::GemHelper.install_tasks

28
artist-website/.gitignore vendored Normal file
View File

@@ -0,0 +1,28 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
dist
dist-ssr
*.local
# tauri
/src-tauri/target
/src-tauri/Cargo.lock
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

13
artist-website/index.html Normal file
View File

@@ -0,0 +1,13 @@
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>藝術家作品集</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>

View File

@@ -0,0 +1,20 @@
{
"name": "artist-website",
"version": "1.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview",
"tauri": "tauri"
},
"dependencies": {
"vue": "^3.4.0"
},
"devDependencies": {
"@tauri-apps/api": "^1.5.0",
"@tauri-apps/cli": "^1.5.0",
"@vitejs/plugin-vue": "^5.0.0",
"vite": "^5.0.0"
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More