From 02262284d0dea4bb1afce5e85e0360564282c321 Mon Sep 17 00:00:00 2001 From: Andreas Lind Date: Wed, 26 Dec 2018 15:24:52 +0100 Subject: [PATCH] Update documentation --- .../assertions/object/to-have-a-value-satisfying.md | 6 +++--- documentation/assertions/object/to-have-keys-satisfying.md | 4 ++-- .../assertions/object/to-have-values-satisfying.md | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/documentation/assertions/object/to-have-a-value-satisfying.md b/documentation/assertions/object/to-have-a-value-satisfying.md index 555619c0c..af3cb12cf 100644 --- a/documentation/assertions/object/to-have-a-value-satisfying.md +++ b/documentation/assertions/object/to-have-a-value-satisfying.md @@ -1,5 +1,5 @@ Asserts that an object contains at least one value that satisfies a given -value, function or other assertion. +value, function (wrapped in `expect.it`) or other assertion. Note that this assertion fails if passed an empty object as the subject. @@ -13,9 +13,9 @@ expect( expect( { foo: 0, bar: 1, baz: 2, qux: 3 }, 'to have a value satisfying', - function(value, index) { + expect.it(function(value) { expect(value, 'to be a number'); - } + }) ); expect( diff --git a/documentation/assertions/object/to-have-keys-satisfying.md b/documentation/assertions/object/to-have-keys-satisfying.md index 0df4fb089..5e6f89d99 100644 --- a/documentation/assertions/object/to-have-keys-satisfying.md +++ b/documentation/assertions/object/to-have-keys-satisfying.md @@ -6,11 +6,11 @@ Aliases: `to be a map whose keys satisfy`, `to be an object whose keys satisfy`, `to be a hash whose keys satisfy`. ```js -expect({ foo: 0, bar: 1, baz: 2, qux: 3 }, 'to have keys satisfying', function( +expect({ foo: 0, bar: 1, baz: 2, qux: 3 }, 'to have keys satisfying', expect.it(function( key ) { expect(key, 'to match', /^[a-z]{3}$/); -}); +})); expect( { foo: 0, bar: 1, baz: 2, qux: 3 }, diff --git a/documentation/assertions/object/to-have-values-satisfying.md b/documentation/assertions/object/to-have-values-satisfying.md index ab34cd473..e40485288 100644 --- a/documentation/assertions/object/to-have-values-satisfying.md +++ b/documentation/assertions/object/to-have-values-satisfying.md @@ -9,9 +9,9 @@ Aliases: `to be a map whose values satisfy`, expect( { foo: 0, bar: 1, baz: 2, qux: 3 }, 'to have values satisfying', - function(value, index) { + expect.it(function(value) { expect(value, 'to be a number'); - } + }) ); expect(