Browse Source

Added measureText() test

v1.x
Tj Holowaychuk 14 years ago
parent
commit
6b84bf4d6f
  1. 9
      test/canvas.test.js

9
test/canvas.test.js

@ -747,6 +747,15 @@ module.exports = {
, 'Context2d#strokeText()');
},
'test Context2d#measureText()': function(assert){
var canvas = new Canvas(200, 200)
, ctx = canvas.getContext('2d');
ctx.font = 'normal 40px Impact';
var te = ctx.measureText('Wahoo');
assert.eql({ width: 111, height: 32 }, te);
},
'test Canvas#toBuffer()': function(assert){
assert.ok(Buffer.isBuffer(new Canvas(200, 200).toBuffer()), 'Canvas#toBuffer() failed');
},

Loading…
Cancel
Save