Skip to content

Commit 8f52a24

Browse files
committed
add some more tests
1 parent 842b7cb commit 8f52a24

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

plugins/runtime-utils_test.go

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ func TestProcessRuntimes(t *testing.T) {
1414
Name: "node",
1515
Version: "18.17.1",
1616
},
17+
{
18+
Name: "flutter",
19+
Version: "3.35.7",
20+
},
1721
}
1822

1923
// Define a test runtime directory
@@ -27,9 +31,15 @@ func TestProcessRuntimes(t *testing.T) {
2731

2832
// Assert we have the expected runtime in the results
2933
assert.Contains(t, runtimeInfos, "node")
34+
assert.Contains(t, runtimeInfos, "flutter")
3035

3136
// Get the node runtime info
3237
nodeInfo := runtimeInfos["node"]
38+
flutterInfo := runtimeInfos["flutter"]
39+
40+
// Basic assertions for flutter
41+
assert.Equal(t, "flutter", flutterInfo.Name)
42+
assert.Equal(t, "3.35.7", flutterInfo.Version)
3343

3444
// Assert the basic runtime info is correct
3545
assert.Equal(t, "node", nodeInfo.Name)
@@ -69,21 +79,21 @@ func TestProcessRuntimes(t *testing.T) {
6979
// Assert the download URL is correctly formatted
7080
expectedDownloadURL := "https://nodejs.org/dist/v18.17.1/" + expectedFileName + "." + expectedExtension
7181
assert.Equal(t, expectedDownloadURL, nodeInfo.DownloadURL)
72-
82+
7383
// Assert binary paths are correctly set
7484
assert.NotNil(t, nodeInfo.Binaries)
7585
assert.Greater(t, len(nodeInfo.Binaries), 0)
76-
86+
7787
// Check if node and npm binaries are present
7888
nodeBinary := nodeInfo.InstallDir + "/bin/node"
7989
npmBinary := nodeInfo.InstallDir + "/bin/npm"
80-
90+
8191
// Add .exe extension for Windows
8292
if runtime.GOOS == "windows" {
8393
nodeBinary += ".exe"
8494
npmBinary += ".exe"
8595
}
86-
96+
8797
assert.Equal(t, nodeBinary, nodeInfo.Binaries["node"])
8898
assert.Equal(t, npmBinary, nodeInfo.Binaries["npm"])
8999
}

0 commit comments

Comments
 (0)