Skip to content

Commit 8d10d92

Browse files
committed
fix(test): fill in mi.url/app.id before booting the scaffolded dev server
pp-dev 1.0 hard-fails startup when mi.url is missing and mi.mode is "embedding" or app.type is "template" (both true for template-vanilla's default config). The dev-server e2e test scaffolds the template as-is and was hitting this validation error instead of a healthy dev server. Patch the placeholder values in before running `npm run dev`, same as a real user would before their first run.
1 parent 20c338e commit 8d10d92

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

test/scaffold.spec.mjs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,18 @@ test('runs dev server for scaffolded vanilla project', async () => {
273273

274274
expect(scaffold.status, `stderr: ${scaffold.stderr}\nstdout: ${scaffold.stdout}`).toBe(0);
275275

276+
// pp-dev 1.0 requires mi.url whenever mi.mode is "embedding" or app.type is "template" — fill in
277+
// the placeholder the template ships commented out, same as a user would before their first `dev`.
278+
const configPath = path.join(targetDir, 'pp-dev.config.js');
279+
const configSource = fs.readFileSync(configPath, 'utf8');
280+
281+
fs.writeFileSync(
282+
configPath,
283+
configSource
284+
.replace("// url: 'https://example.metricinsights.com',", "url: 'https://example.metricinsights.com',")
285+
.replace('// id: 1,', 'id: 1,'),
286+
);
287+
276288
const install = runNpmSync(['install', '--no-audit', '--fund=false'], {
277289
cwd: targetDir,
278290
encoding: 'utf8',

0 commit comments

Comments
 (0)