Skip to content
Merged
Prev Previous commit
Next Next commit
Fix param validation unit test for image()
  • Loading branch information
limzykenneth committed May 13, 2025
commit 55861d8ad2ef07f921c0c3a125d5d5f35d6b3b7e
8 changes: 7 additions & 1 deletion test/unit/core/param_errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ suite('Validate Params', function () {
FramebufferTexture: function() {
return 'mock p5.FramebufferTexture';
},
Renderer: function() {
return 'mock p5.Renderer';
},
Graphics: function() {
return 'mock p5.Graphics';
},
_error: () => {},
};
const mockP5Prototype = {};
Expand Down Expand Up @@ -124,7 +130,7 @@ suite('Validate Params', function () {
console.log(result);
assert.equal(
result.error,
'🌸 p5.js says: Did you mean to put `await` before a loading function? An unexpected Promise was found. Expected Image or Element or Texture or Framebuffer or FramebufferTexture at the first parameter in p5.image().'
'🌸 p5.js says: Did you mean to put `await` before a loading function? An unexpected Promise was found. Expected Image or Element or Texture or Framebuffer or FramebufferTexture or Renderer or Graphics at the first parameter in p5.image().'
);
});
});
Expand Down