[now-cli] Add e2e test for vercel.json and .vercelignore (#4292)

This PR adds a test for a deployment as well as `now dev` to ensure both `vercel.json` and `.vercelignore` are applied.

I also fixed the remaining test helpers to work with `vercel.json`.
This commit is contained in:
Steven
2020-05-07 14:04:37 -04:00
committed by GitHub
parent ad19021969
commit f459db9f83
10 changed files with 41 additions and 28 deletions

View File

@@ -53,8 +53,10 @@ async function testDeployment(
);
}
const configName = 'vercel.json' in bodies ? 'vercel.json' : 'now.json';
// we use json5 to allow comments for probes
const nowJson = json5.parse(bodies['vercel.json'] || bodies['now.json']);
const nowJson = json5.parse(bodies[configName]);
if (process.env.VERCEL_BUILDER_DEBUG) {
if (!nowJson.build) {
@@ -90,7 +92,7 @@ async function testDeployment(
}
}
bodies['now.json'] = Buffer.from(JSON.stringify(nowJson));
bodies[configName] = Buffer.from(JSON.stringify(nowJson));
delete bodies['probe.js'];
const { deploymentId, deploymentUrl } = await nowDeploy(bodies, randomness);