Commit Graph

169 Commits

Author SHA1 Message Date
Nito Buendia b2c2e08641 Remove @since tag from JSDoc 2022-03-16 20:15:09 +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 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 1332f01ca4 Merge branch '3.99' into 4.0 2021-09-23 16:08:44 -07:00
Steve Gravrock 497a7fc3e5 Merge branch 'main' into 3.99 2021-09-23 15:49:47 -07:00
Steve Gravrock be29aa95eb Improved jsdocs for asymmetric equality testers 2021-09-23 11:59:20 -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 fe0a83ba87 Removed support for Internet Explorer 2021-07-23 21:46:15 -07:00
Steve Gravrock c10ab4e704 Updated deprecation links 2021-07-20 16:50:31 -07:00
Steve Gravrock 9b3d4a2bf2 Merge branch '3.99' into 4.0 2021-07-10 09:13:28 -07:00
Steve Gravrock 6cb9507f62 Merge branch 'main' into 3.99 2021-07-10 08:58:14 -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 163f93d6ff Removed constructors from jsdocs of classes that aren't user-constructable 2021-06-21 14:19:31 -07:00
Steve Gravrock 1893bf6c16 Added jsdocs for asymmetric equality testers 2021-06-21 14:09:14 -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 c2a714f168 Removed support for IE 10 and Safari 8 2021-04-23 08:14:19 -07:00
Steve Gravrock 4b2a14f1f3 Removed deprecated custom matcher, matchersUtil, pp, etc interfaces 2021-04-22 22:29:20 -07:00
Steve Gravrock 8b3a6561b1 Merge branch 'main' into 3.99 2021-04-02 11:35:30 -07:00
Surgie Finesse 37073e2768 Fix the review notices 2021-03-22 19:26:33 +10:00
Surgie Finesse f7f928fdd3 Merge remote-tracking branch 'upstream/main' into array_buffer
# Conflicts:
#	spec/core/matchers/matchersUtilSpec.js
2021-03-22 18:33:50 +10:00
leoni laetitia 3234d475cd expect...toEqual check for Symbols 2021-01-31 22:32:58 +01:00
Steve Gravrock 89331bb1bb Fixed comparison between URL objects
* Fixes #1866
2020-11-21 13:47:44 -08:00
Steve Gravrock d27bb8fa96 Run Prettier on all files 2020-09-29 18:05:38 -07:00
Steve Gravrock a1f1b4ae0f Merge branch 'main' into 3.99 2020-09-14 18:39:32 -07:00
Aaron Snailwood 6277046213 fix typo in asyncMatcher toBePending comment 2020-08-20 10:07:35 -07:00
Steve Gravrock 6b9739030d Fixed future deprecations 2020-08-02 12:57:28 -07:00
Steve Gravrock 70c416d5c9 Fixed jsdocs for recent additions 2020-07-10 15:41:02 -07:00
Steve Gravrock aa6cc31057 Show diffs involving root-level asymmetric equality testers
* Fixes #1831
2020-07-08 17:02:11 -07:00
Steve Gravrock 4e2f703615 Check for syntax and standard library objects that don't work in IE 2020-07-01 17:34:59 -07:00
Steve Gravrock ba2aae63be Run eslint against all files 2020-07-01 16:09:14 -07:00
Steve Gravrock b3ab9fad9d Updated toHaveBeenCalledOnceWith for new matcher interface 2020-06-26 15:14:02 -07:00
Maksym Kobieliev 0f6ebaa784 Merge branch 'master' into feat/to-have-been-called-once-with 2020-04-14 22:08:13 +03:00
Steve Gravrock 8991b1bba3 Fixed toHaveSize matcher on IE 10 & 11 2020-04-12 21:22:14 -07:00
DCtheTall 76a99aef86 add missing trailing newline 2020-04-09 15:19:47 -04:00
DCtheTall 6b213a958d Add expectAsync().toBePending() 2020-04-09 15:13:33 -04:00
Maksym Kobieliev bcc28d7063 Output a diff if there was only one call, but with wrong parameters 2020-04-02 21:31:17 +03:00
Gregg Van Hove 79d55216fc Use internal type checks instead of instanceof to support browsers that don't include the types 2020-03-18 08:57:44 -07:00
Gregg Van Hove ec3ebcb7bb Clean up toHaveSize 2020-03-18 08:13:21 -07:00
Francois Wauquier c521b4d47c toHaveSize 2020-03-18 08:13:10 -07:00
Maksym Kobieliev e13fd13529 Add a toHaveBeenCalledOnceWith matcher 2020-03-13 20:41:24 +02:00
Steve Gravrock a6a9550d1e Fixed 'since' versions for MatchersUtil 2020-02-13 10:52:54 -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
Steve Gravrock 5096d9af4e Don't construct unnecessarily asymmetricEqualityTesterArgCompatShims
This speeds up MatchersUtil#equals by about 6-7x.
2020-02-12 14:23:03 -08:00
Steve Gravrock 3be797c8d8 Fixed diffs involving jasmine.objectContaining 2020-02-12 14:22:51 -08:00
Steve Gravrock c2ada1af95 Merge branch 'custom-object-formatters' into cof-merge-candidate 2020-02-11 13:51:17 -08:00
Pivotal ea3dd9dffc Refer to MatchersUtil instances as matchersUtil, not util 2020-02-10 17:26:05 -08:00
Steve Gravrock d41139fea2 Added jsdocs for MatchersUtil 2020-02-10 17:26:05 -08:00
Steve Gravrock 873d1c2945 Use custom object formatters for any part of a diff, not just leaf nodes 2020-02-10 17:26:00 -08:00
Steve Gravrock 25816a6e77 Added support for custom object formatters
Custom object formatters allow users to customize how an object is
stringified in matcher failure messages. This can already be done by
adding a `jasmineToString` method to the objects in question. But
it's not always desirable or possible to do that, particularly when
objects of a given "type" do not inherit from a specific prototype.
For instance, suppose a web service returns a list of foos that are
deserialized from JSON, e.g.:

   { fooId: 42, /* more properties */ }

The only way to define `jasmineToString` on those is by writing code to
add it to each instance at runtime. But a custom object formatter can
recognize that the object it's looking at is a foo and format it
accordingly:

   jasmine.addCustomObjectFormatter(function(obj) {
      if (typeof obj.fooId !== 'number') {
            return undefined;
        }

        return '[Foo with ID ' + obj.fooId + ']';
    });

Unlike `jasmineToString`, custom object formatters are scoped to a
particular spec or suite and don't require any changes to the code
under test.
2020-02-10 17:26:00 -08:00