A matcher that partially matches a Map
.
This matcher allows you to specify a subset of keys in a Map
to be matched,
without having to match every key in a Map
. This is useful for specific conditions
in an HTTP response without validating the entire data structure, especially when that
data structure is large. See hasResponse for more details.
Usage:
var response = await client.request("/foo").get();
// Validates that the key 'id' is an integer, but the map may contain more keys.
expect(response, hasResponse(200, partial({"id": isInteger})));
Source
_PartialMapMatcher partial(Map map) => new _PartialMapMatcher(map);