[tests] Return an empty array if nowJson.builds is empty (#3886)

* return an empty array if nowJson.builds is empty
  * https://github.com/zeit/now/pull/3622#issuecomment-578995344
  * extracted from PR discussion
    * occur after following change a645d4ee88
  * kudos to @styfle

/cc @styfle
This commit is contained in:
m5o
2020-03-06 21:12:44 +01:00
committed by GitHub
parent 533b059947
commit 9d19d02a0a

View File

@@ -64,7 +64,7 @@ async function testDeployment(
nowJson.build.env.NOW_BUILDER_DEBUG = process.env.NOW_BUILDER_DEBUG;
}
for (const build of nowJson.builds) {
for (const build of nowJson.builds || []) {
if (builderUrl) {
if (builderUrl === '@canary') {
build.use = `${build.use}@canary`;