Skip to content

Commit e5e0a7d

Browse files
committed
Adds Error message for when there are no screenshots and the developer might need to wait for a promise
1 parent 3d45ce9 commit e5e0a7d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

test/unit/visual/visualTest.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,12 @@ window.visualTest = function(
151151
actual.push(myp5.get());
152152
});
153153

154+
155+
if (actual.length === 0) {
156+
throw new Error('No screenshots were generated. Check if your test generates screenshots correctly.If the test includes asynchronous operations, ensure they complete before the test ends.');
157+
}
158+
159+
154160
if (expectedScreenshots && actual.length !== expectedScreenshots) {
155161
throw new Error(
156162
`Expected ${expectedScreenshots} screenshot(s) but generated ${actual.length}`

0 commit comments

Comments
 (0)