Skip to content

Commit 171c30f

Browse files
committed
add test
1 parent 0060b83 commit 171c30f

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/nodejs/integration/sealights_test.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ func testSealights(platform switchblade.Platform, fixtures string) func(*testing
104104

105105
pkg["scripts"] = map[string]string{
106106
"start": "node server.js",
107+
"start-app": "node app.js",
107108
}
108109

109110
content, err = json.Marshal(pkg)
@@ -127,6 +128,23 @@ func testSealights(platform switchblade.Platform, fixtures string) func(*testing
127128
ContainSubstring(`"start":"./node_modules/.bin/slnodejs run --useinitialcolor true --token token1 --buildsessionid bs1 server.js"`),
128129
).WithEndpoint("/fs/package.json"))
129130
})
131+
132+
it("modifies the package.json command", func() {
133+
deployment, _, err := platform.Deploy.
134+
WithEnv(map[string]string{"SL_BUILD_SESSION_ID": "bs1"}).
135+
WithServices(map[string]switchblade.Service{
136+
"sealights-service": {
137+
"token": "token1",
138+
"npmRunScript": "start-app",
139+
},
140+
}).
141+
Execute(name, source)
142+
Expect(err).NotTo(HaveOccurred())
143+
144+
Eventually(deployment).Should(Serve(
145+
ContainSubstring(`"start-app":"./node_modules/.bin/slnodejs run --useinitialcolor true --token token1 --buildsessionid bs1 server.js"`),
146+
).WithEndpoint("/fs/package.json"))
147+
})
130148
})
131149
}
132150
}

0 commit comments

Comments
 (0)