Skip to content

Commit

Permalink
Adds Error message for when there are no screenshots and the develope…
Browse files Browse the repository at this point in the history
…r might need to wait for a promise
  • Loading branch information
diyaayay committed Jan 27, 2024
1 parent 3d45ce9 commit e5e0a7d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/unit/visual/visualTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,12 @@ window.visualTest = function(
actual.push(myp5.get());
});


if (actual.length === 0) {
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.');
}


if (expectedScreenshots && actual.length !== expectedScreenshots) {
throw new Error(
`Expected ${expectedScreenshots} screenshot(s) but generated ${actual.length}`
Expand Down

0 comments on commit e5e0a7d

Please sign in to comment.