From c8735b4c93a6910a5d15a8e93e2eeecfb9c37cf0 Mon Sep 17 00:00:00 2001 From: Alex J Burke Date: Sat, 22 Jun 2019 14:01:09 +0200 Subject: [PATCH] Add a success case example of a array-like subset "to satisfy". --- documentation/assertions/any/to-satisfy.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/documentation/assertions/any/to-satisfy.md b/documentation/assertions/any/to-satisfy.md index 6246977d5..2870b6230 100644 --- a/documentation/assertions/any/to-satisfy.md +++ b/documentation/assertions/any/to-satisfy.md @@ -48,6 +48,14 @@ In order to make statements about a subset of the available indices, an object specification on the right hand side can mention specific indexes as keys which are themselves compared using `to satisfy` semantics: +```js +expect([{ greeting: true }, { hey: { there: true } }], 'to satisfy', { + 1: { hey: { there: true } } +}); +``` + +In the case of a failing expectation, output such as the following is generated: + ```js expect(['foo', 'catch me', 'baz'], 'to satisfy', { 1: 'bar' }); ```