Skip to content

Commit 8ddfc81

Browse files
committed
Add test
1 parent 9e20591 commit 8ddfc81

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

test/unit/visual/cases/webgl.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@ visualSuite('WebGL', function() {
692692
});
693693
});
694694

695-
visualSuite('textures in p5.strands', async () => {
695+
visualSuite('textures in p5.strands', () => {
696696
visualTest('uniformTexture() works', async (p5, screenshot) => {
697697
p5.createCanvas(50, 50, p5.WEBGL);
698698
const tex = await p5.loadImage('/unit/assets/cat.jpg');
@@ -708,4 +708,18 @@ visualSuite('WebGL', function() {
708708
screenshot();
709709
});
710710
});
711+
712+
visualSuite('p5.strands', () => {
713+
visualTest('it recovers from p5.strands errors', (p5, screenshot) => {
714+
p5.createCanvas(50, 50, p5.WEBGL);
715+
try {
716+
p5.baseMaterialShader().modify(() => {
717+
undefined.someMethod(); // This will throw an error
718+
});
719+
} catch (e) {}
720+
p5.background('red');
721+
p5.circle(p5.noise(0), p5.noise(0), 20);
722+
screenshot();
723+
});
724+
});
711725
});
591 Bytes
Loading
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"numScreenshots": 1
3+
}

0 commit comments

Comments
 (0)