From 6b84bf4d6f0445f170420ecc6e20b1e16ae337d1 Mon Sep 17 00:00:00 2001 From: Tj Holowaychuk Date: Tue, 2 Nov 2010 10:09:19 -0700 Subject: [PATCH] Added measureText() test --- test/canvas.test.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/canvas.test.js b/test/canvas.test.js index a381792..c379111 100644 --- a/test/canvas.test.js +++ b/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'); },