Skip to content

Instantly share code, notes, and snippets.

@eladb
Created July 4, 2012 09:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eladb/3046222 to your computer and use it in GitHub Desktop.
Save eladb/3046222 to your computer and use it in GitHub Desktop.
cantest - hello-test
var Canvas = require('canvas');
var hello = require('./hello');
// tests the `hello` rendering function
module.exports = function() {
var canvas = new Canvas(120, 120);
var ctx = canvas.getContext('2d');
// call `hello` to do it's magic
hello(ctx);
// test must return `Canvas` object
return canvas;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment