mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-09 04:22:07 +00:00
[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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user