Skip to content

Commit e17de28

Browse files
committed
fix: skip snap test directories without steps.json
Print a warning and skip test case directories that are missing steps.json instead of crashing with ENOENT.
1 parent 56ff7f9 commit e17de28

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
[1]> vp fmt --check # Test that vp fmt --check ignores the temp config file
22
Checking formatting...
33
src/valid.js (<variable>ms)
4-
steps.json (<variable>ms)
54

6-
Format issues found in above 2 files. Run without `--check` to fix.
5+
Format issues found in above 1 files. Run without `--check` to fix.
76
Finished in <variable>ms on 4 files using <variable> threads.

packages/tools/src/snap-test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,10 @@ export async function snapTest() {
130130
if (caseName.startsWith('.')) {
131131
continue;
132132
} // Skip hidden files like .DS_Store
133+
if (!fs.existsSync(path.join(casesDir, caseName, 'steps.json'))) {
134+
console.warn('Warning: %s has no steps.json, skipping', caseName);
135+
continue;
136+
}
133137
if (caseName.includes(filter)) {
134138
taskFunctions.push(() => runTestCase(caseName, tempTmpDir, casesDir, values['bin-dir']));
135139
}

0 commit comments

Comments
 (0)