diff --git a/src/Context/JsonContext.php b/src/Context/JsonContext.php index f9a13b56..2a10ee06 100644 --- a/src/Context/JsonContext.php +++ b/src/Context/JsonContext.php @@ -207,7 +207,13 @@ public function theJsonNodeShouldHaveElements($node, $count): void $actual = $this->inspector->evaluate($json, $node); - $this->assertSame($count, \count((array) $actual)); + $actualCount = \count((array) $actual); + + $this->assertSame( + $count, + $actualCount, + 'The node "'.$node.'" contains '.$actualCount.' elements ('.$count.' expected).' + ); } /**