Skip to content

Commit f04d17c

Browse files
add integration test
1 parent 2515d05 commit f04d17c

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

internal/integrationtest/lib/lib_test.go

+38
Original file line numberDiff line numberDiff line change
@@ -1756,3 +1756,41 @@ func TestDependencyResolverNoOverwrite(t *testing.T) {
17561756
_, _, err = cli.Run("lib", "install", "[email protected]", "--no-overwrite")
17571757
require.NoError(t, err)
17581758
}
1759+
1760+
func TestLibListContainsDependenciesField(t *testing.T) {
1761+
env, cli := integrationtest.CreateArduinoCLIWithEnvironment(t)
1762+
defer env.CleanUp()
1763+
1764+
_, _, err := cli.Run("lib", "update-index")
1765+
require.NoError(t, err)
1766+
1767+
_, _, err = cli.Run("lib", "install", "[email protected]")
1768+
require.NoError(t, err)
1769+
stdOut, _, err := cli.Run("lib", "list", "--json")
1770+
require.NoError(t, err)
1771+
requirejson.Contains(t, stdOut, `{"installed_libraries": [ { "library": {
1772+
"name":"Arduino_ConnectionHandler",
1773+
"version": "0.6.6",
1774+
"dependencies": [
1775+
{"name": "Arduino_DebugUtils"},
1776+
{"name": "WiFi101"},
1777+
{"name": "WiFiNINA"},
1778+
{"name": "MKRGSM"},
1779+
{"name": "MKRNB"},
1780+
{"name": "MKRWAN"}
1781+
]
1782+
} } ]}`)
1783+
1784+
_, _, err = cli.Run("lib", "install", "[email protected]")
1785+
require.NoError(t, err)
1786+
stdOut, _, err = cli.Run("lib", "list", "--json")
1787+
require.NoError(t, err)
1788+
requirejson.Contains(t, stdOut, `{"installed_libraries": [ { "library": {
1789+
"name":"DebugLog",
1790+
"version": "0.8.4",
1791+
"dependencies": [
1792+
{"name": "ArxContainer", "version_constraint": ">=0.6.0"},
1793+
{"name": "ArxTypeTraits"}
1794+
]
1795+
} } ]}`)
1796+
}

0 commit comments

Comments
 (0)