Skip to content

Commit 15d01aa

Browse files
authored
[skip-changelog] Fixed integration test (#1967)
1 parent fffbeaa commit 15d01aa

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Diff for: internal/integrationtest/lib/lib_test.go

+8-2
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,10 @@ func TestLibInstallMultipleSameLibrary(t *testing.T) {
9797
require.NoError(t, err)
9898
jsonOut, _, err := cli.Run("lib", "list", "--format", "json")
9999
require.NoError(t, err)
100-
requirejson.Len(t, jsonOut, 1, "A duplicate library install has been detected")
100+
// Count how many libraries with the name "Arduino SigFox for MKRFox1200" are installed
101+
requirejson.Parse(t, jsonOut).
102+
Query(`[.[].library.name | select(. == "Arduino SigFox for MKRFox1200")]`).
103+
LengthMustEqualTo(1, "Found multiple installations of Arduino SigFox for MKRFox1200'")
101104

102105
// Check that 'lib upgrade' didn't create a double install
103106
// https://github.com/arduino/arduino-cli/issues/1870
@@ -109,7 +112,10 @@ func TestLibInstallMultipleSameLibrary(t *testing.T) {
109112
require.NoError(t, err)
110113
jsonOut, _, err = cli.Run("lib", "list", "--format", "json")
111114
require.NoError(t, err)
112-
requirejson.Len(t, jsonOut, 1, "A duplicate library install has been detected")
115+
// Count how many libraries with the name "Arduino SigFox for MKRFox1200" are installed
116+
requirejson.Parse(t, jsonOut).
117+
Query(`[.[].library.name | select(. == "Arduino SigFox for MKRFox1200")]`).
118+
LengthMustEqualTo(1, "Found multiple installations of Arduino SigFox for MKRFox1200'")
113119
}
114120

115121
func TestDuplicateLibInstallDetection(t *testing.T) {

0 commit comments

Comments
 (0)