@@ -26,6 +26,7 @@ func Test_applyFileTargets(t *testing.T) {
26
26
Name : "name" ,
27
27
RepoURL : "../test.local" ,
28
28
Up : []string {"echo" , "hello world" },
29
+ Env : map [string ]string {},
29
30
},
30
31
}, false },
31
32
{"variable" , `
@@ -37,9 +38,9 @@ func Test_applyFileTargets(t *testing.T) {
37
38
38
39
console.log("done!");
39
40
` , task.Targets {
40
- {Name : "1" , RepoURL : "https://github.com/Southclaws/project1" , Up : []string {"sleep" }},
41
- {Name : "2" , RepoURL : "https://github.com/Southclaws/project2" , Up : []string {"sleep" }},
42
- {Name : "3" , RepoURL : "https://github.com/Southclaws/project3" , Up : []string {"sleep" }},
41
+ {Name : "1" , RepoURL : "https://github.com/Southclaws/project1" , Up : []string {"sleep" }, Env : map [ string ] string {} },
42
+ {Name : "2" , RepoURL : "https://github.com/Southclaws/project2" , Up : []string {"sleep" }, Env : map [ string ] string {} },
43
+ {Name : "3" , RepoURL : "https://github.com/Southclaws/project3" , Up : []string {"sleep" }, Env : map [ string ] string {} },
43
44
}, false },
44
45
{"envmap" , `
45
46
var url = "https://github.com/Southclaws/";
@@ -65,8 +66,8 @@ func Test_applyFileTargets(t *testing.T) {
65
66
` , task.Targets {
66
67
{Name : "name" , RepoURL : "../test.local" , Up : []string {"sleep" }, Env : map [string ]string {"GLOBAL" : "readme" , "LOCAL" : "hi" }},
67
68
}, false },
68
- {"badtype" , `T({name: "name", url: "../test.local", up: 1.23})` , task.Targets {{} }, true },
69
- {"missingkey" , `T({name: "name", url: "../test.local"})` , task.Targets {{} }, true },
69
+ {"badtype" , `T({name: "name", url: "../test.local", up: 1.23})` , task.Targets {}, true },
70
+ {"missingkey" , `T({name: "name", url: "../test.local"})` , task.Targets {}, true },
70
71
{"env" , `console.log(ENV["TEST_ENV_KEY"])` , task.Targets {}, false },
71
72
{"hostname" , `console.log(HOSTNAME)` , task.Targets {}, false },
72
73
}
@@ -81,7 +82,7 @@ func Test_applyFileTargets(t *testing.T) {
81
82
82
83
os .Setenv ("TEST_ENV_KEY" , "an environment variable inside the JS vm" )
83
84
84
- err := cb .construct ()
85
+ err := cb .construct ("host" )
85
86
if tt .wantErr {
86
87
assert .Error (t , err )
87
88
return
0 commit comments