fix(electron): identify each unresolved scenario path (#2279)
Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import { join } from "node:path";
|
||||
import { createTestTempDirectory } from "../../fixtures/temporaryDirectory.js";
|
||||
import { describe, expect } from "vitest";
|
||||
|
||||
import { cliTest } from "../../support/cli/cliFixture.js";
|
||||
@@ -62,3 +64,42 @@ describe("scenario CLI schema diagnostics", () => {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
for (const field of [
|
||||
"executable_path",
|
||||
"application_path",
|
||||
"application_root",
|
||||
] as const) {
|
||||
cliTest(`names the unresolved Electron ${field}`, async ({ cli }) => {
|
||||
const root = await createTestTempDirectory("rea-electron-path-");
|
||||
const missing = join(root, "missing");
|
||||
const result = await cli.run({
|
||||
arguments: [
|
||||
"capture-electron-scenario",
|
||||
JSON.stringify({
|
||||
executable_path: process.execPath,
|
||||
application_path: root,
|
||||
application_root: root,
|
||||
actions: [],
|
||||
[field]: missing,
|
||||
}),
|
||||
"--json",
|
||||
],
|
||||
environment: { REA_LOG_LEVEL: "silent" },
|
||||
});
|
||||
expect(result.exitCode).toBe(1);
|
||||
expect(result.json).toMatchObject({
|
||||
code: "invalid_request",
|
||||
details: {
|
||||
issues: [
|
||||
{
|
||||
path: [field],
|
||||
reason: "invalid_value",
|
||||
message: expect.stringContaining("ENOENT"),
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
expect(JSON.stringify(result.json)).toContain(missing);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user