Skip to content

Commit e1e4cbc

Browse files
committed
test(qa): prove native E2E scenario execution
1 parent 8561bef commit e1e4cbc

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

‎extensions/qa-lab/src/test-file-scenario-runner.e2e-routing.test.ts‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,22 @@ describe("QA native Vitest scenario routing", () => {
3939
scenarios: [scenario],
4040
runCommand: async (command) => {
4141
commands.push(command);
42+
const reportArg = command.args.find((arg) => arg.startsWith("--outputFile.json="));
43+
if (!reportArg) {
44+
throw new Error("native Vitest scenario did not request a JSON test report");
45+
}
46+
await fs.writeFile(
47+
reportArg.slice("--outputFile.json=".length),
48+
JSON.stringify({ numFailedTests: 0, numPassedTests: 1, success: true }),
49+
"utf8",
50+
);
4251
return { exitCode: 0, stdout: "1 passed\n", stderr: "" };
4352
},
4453
});
4554

4655
expect(result.executionKind).toBe("vitest");
4756
expect(result.results).toMatchObject([{ status: "pass" }]);
57+
expect(result.evidence.entries[0]?.result.status).toBe("pass");
4858
expect(commands.map((command) => command.args)).toEqual([
4959
[
5060
"scripts/run-vitest.mjs",
@@ -53,6 +63,14 @@ describe("QA native Vitest scenario routing", () => {
5363
"test/vitest/vitest.e2e.config.ts",
5464
testPath,
5565
"--reporter=verbose",
66+
"--reporter=json",
67+
`--outputFile.json=${path.join(
68+
repoRoot,
69+
".artifacts",
70+
"qa-e2e",
71+
scenario.id,
72+
`${scenario.id}.vitest-report.json`,
73+
)}`,
5674
],
5775
]);
5876
} finally {

0 commit comments

Comments
 (0)