canvas-sketch icon indicating copy to clipboard operation
canvas-sketch copied to clipboard

Add Unit Tests

Open helloitsjoe opened this issue 3 years ago • 1 comments

Hi Matt!

I noticed in your readme you want to add unit tests - I've set up Jest for canvas-sketch and added a few basic tests just to get the ball rolling. I'm happy to add more but wanted to submit a PR early in case you have any feedback.

  • Add jest
  • Set up babel to handle ES6 import syntax
  • Add unit tests for createCanvas and SketchManager

helloitsjoe avatar Oct 21 '20 12:10 helloitsjoe

I had some time so I added a few more tests.

Also, It looks like the Netlify pipeline isn't passing because it's still on Node 8, but Jest 26/27 require Node 10 or above. I would downgrade to Jest 24, but it doesn't play as nicely with the canvas package (and also Node 8 is no longer supported)

helloitsjoe avatar Nov 06 '20 20:11 helloitsjoe