1078 Commits

Author SHA1 Message Date
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 57c294b307 Added a migration guide link to multiple done call deprecations 2021-12-14 08:16:06 -08:00
Steve Gravrock f3b26a0688 Merge branch 'main' into 3.99 2021-11-26 13:25:14 -08:00
Steve Gravrock 439be97c34 Rephrased note about verboseDeprecations 2021-11-24 11:45:32 -08:00
Jan Molak 2c440b8e44 Fixed result.pendingReason for specs marked with xit. Closes #1939 2021-10-22 17:58:31 +01:00
Steve Gravrock ab34f272da Merge branch 'main' into 3.99 2021-10-15 10:29:50 -07:00
Steve Gravrock c1db8f2f82 Clarified deprecation message for this in describes 2021-10-12 15:40:13 -07:00
Andre Willomitzer bb9175cb66 added additional error msg for delayedExpectation
added matching error msgs in jasmine objects

Ran prettier.

removed indenting, formatted column length < 80
2021-10-12 13:17:24 -04: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
Nico Jansen 503715c275 test(ie): refactor promises to callbacks 2021-10-07 10:23:52 +02:00
Nico Jansen 1fc911e0fa Support running jasmine multiple times
Add support for running jasmine multiple times.

```js
const Jasmine = require('jasmine');

async function main() {
  const jasmine = new Jasmine({ projectBaseDir: process.cwd() });
  let specId = 'spec0';
  jasmine.loadConfigFile('./spec/support/jasmine.json');
  jasmine.env.configure({
    specFilter(sp) {
      return sp.id === specId;
    },
    autoCleanClosures: false
  });
  jasmine.exit = () => {};
  await jasmine.execute();
  specId = 'spec2';
  await jasmine.execute();
}

main().catch((err) => {
  console.error(err);
  process.exitCode = 1;
});
```

With `jasmine.env.configure({ autoCleanClosures: false })` you disable Jasmine's feature to automatically clean closures (functions) during the test run. This is a requirement to be able to rerun.

When `execute` is called more than once, the `topSuite.reset` is called, which will reset the state for the next run as well as reset any child suites.

Add a function `exclude` to the `Suite` and `Spec` clases. This functions similar to `pend`, but will allow the "pending" state to persist over multiple runs. This is useful when `xit` is used.

Revert changes to jasmine.js

fix: make sure to call hooks during second run

Remove jsdoc from private apis

Fix elint issue

Add new line
2021-10-06 20:12:45 +02:00
Steve Gravrock 7f0087b805 Merge branch 'main' into 3.99 2021-10-02 09:47:30 -07:00
Steve Gravrock fdad8849df Revert "Added the ability to associate trace information with failing specs"
Pushing this back to 4.0 in hopes of increasing the chance that third
party reporters will notice it and add support.

This reverts commit 7a289f1de7.
2021-10-02 09:45:15 -07:00
Steve Gravrock 7a289f1de7 Added the ability to associate trace information with failing specs
This is meant to aid in debugging failures, particularly intermittent
failures, in cases where interactive debugging or console.log aren't
suitable.
2021-09-25 16:19:28 -07:00
Steve Gravrock c3fb3e985a Reject timeout values that are too large for setTimeout
See #1930
2021-09-25 15:43:31 -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 40be00310d Don't immediately move to the next queueable fn on async error
This allows assertion failures and other errors that occcur after the async
error to be routed to the correct spec/suite.

Previously, Jasmine treated global errors and unhandled promise rejections
just like exceptions thrown from a synchronous spec: it recorded the error
as a spec failure and moved on. Now, global errors and uhandled rejections
are recorded as failures but the current queueable fn will continue until
it either signals completion or times out. Global errors and unhandled
rejections are different from synchronous exceptions: it's common for the
queueable fn that caused them to continue executing. Immediately moving on
often meant that the queueable fn would produce expectation failures or
other errors when a different spec or suite was running, thus causing
those failures to be routed to the wrong place.
2021-09-24 11:22:04 -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 e3c9a59c6c Added a stringContaining asymmetric equality tester
* Fixes #1923.
2021-09-22 11:28:24 -07:00
Steve Gravrock af5984d5d6 Fixed flake list 2021-09-10 17:53:59 -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 3a47a3bd04 Fixed flaky spec 2021-09-06 15:35:37 -07:00
Steve Gravrock 2fd9d7b13f Merge branch 'main' into 3.99 2021-08-17 17:08:34 -07:00
Steve Gravrock dd8a65cb60 Better reporting of unhandled promise rejections with truthy but non-Error reasons on Node
[#179227413]
2021-08-14 14:03:03 -07:00
Steve Gravrock e72d161fab Return a promise from Env#execute in environments that support promises
[#178373231]
2021-08-07 13:05:55 -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 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 b696bec9e3 Renamed failFast and oneFailurePerSpec config props to stopOnSpecFailure and stopSpecOnExpectationFailure
The new names are more self-explanatory and consistent with jasmine-npm. The
old names are deprecated but still work.

[#178682783]
2021-07-31 07:51:50 -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 1206952ca6 Merge branch 'main' into 3.99 2021-07-26 18:19:11 -07:00
Steve Gravrock 286524959b Split boot.js in two to allow the env to be configured in between
This is mainly intended to support jasmine-browser-runner, which will load
a script that configures the env in between the two boot files (boot0.js and
boot1.js). The single-file boot.js is retained for now but will be removed
in a future release.
2021-07-26 18:05:36 -07:00
Steve Gravrock 70d49e5b57 Deprecate non-Error arguments passed to done()
[Finishes #178267600]
2021-07-24 09:18:24 -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 88b90ec258 Backfilled unit tests for j$.isError_ 2021-07-19 10:31:53 -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 3e64ce3310 Removed property tests for MatchersUtil#equals
These might be useful for a function with a more restricted domain. But for
equals, which accepts two of literally anything, the short run was too short
to catch any problems and the long run tended to exceed the CircleCi timeout.
2021-07-03 08:37:15 -07:00
Joris Stolwijk e4c7d8af45 new attempt for fixing #1906: add window.location.pathname to hrefs + comments + fixed tests 2021-06-29 14:03:25 +02:00
Steve Gravrock ee88ecc614 Revert "add url pathName in toQueryString function - fixes (https://github.com/jasmine/jasmine/issues/1906 ) + comment + test"
Reverted because it breaks the option checkboxes in the HTML reporter, both
in the standalone distribution and in jasmine-browser-runner.

Reopens #1906.

This reverts commit 1e4f0d1545.
2021-06-28 12:42:05 -07:00
Steve Gravrock dbc1a0aa56 Added expectAsync(...).already
* Causes async matchers to immediately fail if the promise is pending
* Fixes #1845
2021-06-23 20:13:01 -07:00
Steve Gravrock 5862b22aef Include rejection details in failure messages for toBeResolved and toBeResolvedWith
[#178559119]
2021-06-21 16:43:51 -07:00
Steve Gravrock 68db3f6fcf Merge branch 'select-spec' of https://github.com/jlpstolwijk/jasmine into main
* Merges #1907 from @jlpstolwijk
* Fixes #1906
* Fixes spec filtering in karma-jasmine-html-reporter
2021-06-14 17:59:29 -07:00
Joris Stolwijk 1e4f0d1545 add url pathName in toQueryString function - fixes (https://github.com/jasmine/jasmine/issues/1906 ) + comment + test 2021-06-14 15:05:12 +02:00