From 2c95f98231b3dbcd96ff722206c9ed3e9edb8d1a Mon Sep 17 00:00:00 2001 From: Dan Luhring Date: Fri, 22 Jan 2021 15:20:42 -0500 Subject: [PATCH] Improve output for test case Signed-off-by: Dan Luhring --- syft/cataloger/javascript/parse_package_json_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/syft/cataloger/javascript/parse_package_json_test.go b/syft/cataloger/javascript/parse_package_json_test.go index 6ac5f162a2f..83af1f9b1d0 100644 --- a/syft/cataloger/javascript/parse_package_json_test.go +++ b/syft/cataloger/javascript/parse_package_json_test.go @@ -155,7 +155,7 @@ func TestParsePackageJSON_Partial(t *testing.T) { // see https://github.com/anch t.Fatalf("failed to parse package-lock.json: %+v", err) } - if len(actual) != 0 { - t.Errorf("no packages should've been returned") + if actualCount := len(actual); actualCount != 0 { + t.Errorf("no packages should've been returned (but got %d packages)", actualCount) } }