diff --git a/package.json b/package.json index 1e1e67a..7020663 100644 --- a/package.json +++ b/package.json @@ -9,11 +9,11 @@ "test": "make test" } , "devDependencies": { - "express": ">= 2.3.7 && < 3.0.0" - , "jade": "0.11.0" + "express": "3.0" + , "jade": "0.28.1" , "mocha": "*" , "should": "*" } - , "engines": { "node": ">= 0.4.0" } + , "engines": { "node": ">= 0.6.0" } , "main": "./lib/canvas.js" } diff --git a/test/server.js b/test/server.js index 4fab06c..e25572c 100644 --- a/test/server.js +++ b/test/server.js @@ -6,12 +6,10 @@ var express = require('express') , Canvas = require('../lib/canvas') , Image = Canvas.Image - , jade = require('jade') - , app = express.createServer(); + , app = express(); // Config -app.register('.jade', jade); app.set('views', __dirname + '/views'); app.set('view engine', 'jade'); @@ -22,7 +20,7 @@ app.use(express.logger('dev')); app.use(express.bodyParser()); app.use(app.router); app.use(express.static(__dirname + '/public')); -app.use(express.errorHandler({ showStack: true })); +app.use(express.errorHandler()); // Routes @@ -36,7 +34,7 @@ app.post('/render', function(req, res, next){ req.body.fn = req.body.fn .replace("'state.png'", "'" + __dirname + "/public/state.png'") .replace("'face.jpeg'", "'" + __dirname + "/public/face.jpeg'"); - + // Do not try this at home :) var fn = eval('(' + req.body.fn + ')') , width = req.body.width @@ -52,10 +50,11 @@ app.post('/render', function(req, res, next){ }); } - 2 == fn.length + 2 == fn.length ? fn(ctx, done) : fn(ctx), done(); }); -app.listen(parseInt(process.argv[2] || '3000', 10)); -console.log('Test server listening on port %d', app.address().port); \ No newline at end of file +var port = parseInt(process.argv[2] || '4000', 10); +app.listen(port); +console.log('Test server listening on port %d', port); diff --git a/test/views/layout.jade b/test/views/layout.jade index 0dd190a..132827e 100644 --- a/test/views/layout.jade +++ b/test/views/layout.jade @@ -6,4 +6,4 @@ html script(src='/tests.js') script(src='/app.js') body - #primary!= body + block content diff --git a/test/views/tests.jade b/test/views/tests.jade index f437ced..71f1891 100644 --- a/test/views/tests.jade +++ b/test/views/tests.jade @@ -1,19 +1,23 @@ -h1 node-canvas -p.msg - | The tests below assert visual and api integrity by running the - em exact - | same code utilizing the client canvas api, as well as node-canvas. +extend layout -p - | Click to - a#run(href='#') re-run - | the test suite or "r". +block content + h1 node-canvas -table#tests - thead - tr - th node-canvas - th target - th - tbody \ No newline at end of file + p.msg + | The tests below assert visual and api integrity by running the + em  exact  + | same code utilizing the client canvas api, as well as node-canvas. + + p + | Click to + a#run(href='#')  re-run  + | the test suite or "r". + + table#tests + thead + tr + th node-canvas + th target + th + tbody