to have values satisfying
- <object> to have values [exhaustively] satisfying <assertion>
- <object> to have values [exhaustively] satisfying <any>
Asserts that all values of an object satisfy a given assertion or function.
Notice this assertion fails when given an empty object.
Aliases: to be a map whose values satisfy
,
to be an object whose values satisfy
, to be a hash whose values satisfy
.
expect({ foo: 0, bar: 1, baz: 2, qux: 3 },'to have values satisfying',expect.it(function (value) {expect(value, 'to be a number');}));expect({ foo: 0, bar: 1, baz: 2, qux: 3 },'to have values satisfying','to be a number');
In case of a failing expectation you get the following output:
expect({ foo: [0, 1, 2], bar: [4, 5, 6], baz: [7, 8, 9] },'to have values satisfying','to have items satisfying',expect.it('to be a number').and('to be below', 8));
expected object to have values satisfyingto have items satisfying expect.it('to be a number').and('to be below', 8){foo: [ 0, 1, 2 ],bar: [ 4, 5, 6 ],baz: [7,8,////✓andshould be a number⨯should be below 89////✓andshould be a number⨯should be below 8]}