Skip to content

Commit 21cc745

Browse files
fix(tests): fail a run whose selected case names no test in the file
A renamed or misspelled `only` path skipped every case, and the run was then saved as passing. The harness now rejects unknown names, so the run is recorded as an error with the names it could not find. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EHGBgHrtePpi7KMrEfy41R
1 parent 15dd811 commit 21cc745

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎apps/sim/sandbox-tasks/workflow-test.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,11 @@ const HARNESS = `
488488
async run() {
489489
const plan = this.collect();
490490
const { only } = await call('testPlan', {});
491+
if (only) {
492+
const known = new Set(plan.tests.map((t) => t.path.join(' > ')));
493+
const unknown = only.filter((name) => !known.has(name));
494+
if (unknown.length > 0) throw new Error('No test is named ' + unknown.map((name) => '"' + name + '"').join(', ') + ' in this file');
495+
}
491496
const results = [];
492497
await runSuiteTree(root, only, results);
493498
return {

0 commit comments

Comments
 (0)