Permalink
Browse files

expresso -> mocha

  • Loading branch information...
tj committed Jan 5, 2012
1 parent 46d57fb commit 078a8572d328e6652c28b70039c6df28a046fdbd
Showing with 21 additions and 27 deletions.
  1. +3 −1 Makefile
  2. +2 −1 package.json
  3. +4 −7 test/canvas.test.js
  4. +12 −18 test/image.test.js
View
@@ -5,7 +5,9 @@ $(ADDON): src/*.cc
node-waf configure build
test: $(ADDON)
@./node_modules/.bin/expresso \
@./node_modules/.bin/mocha \
--ui exports \
--require should \
test/*.test.js
test-server: $(ADDON)
View
@@ -10,8 +10,9 @@
}
, "devDependencies": {
"express": "2.3.7"
, "expresso": "0.7.6"
, "jade": "0.11.0"
, "mocha": "*"

This comment has been minimized.

Show comment
Hide comment
@LinusU

LinusU Dec 21, 2017

Collaborator

😱

@LinusU

LinusU Dec 21, 2017

Collaborator

😱

, "should": "*"
}
, "engines": { "node": ">= 0.4.0 && < 0.7.0" }
, "main": "./lib/canvas.js"
View
@@ -16,11 +16,11 @@ console.log(' cairo: %s', Canvas.cairoVersion);
module.exports = {
'test .version': function(){
assert.match(Canvas.version, /^\d+\.\d+\.\d+$/);
Canvas.version.should.match(/^\d+\.\d+\.\d+$/);
},
'test .cairoVersion': function(){
assert.match(Canvas.cairoVersion, /^\d+\.\d+\.\d+$/);
Canvas.cairoVersion.should.match(/^\d+\.\d+\.\d+$/);
},
'test .parseFont()': function(){
@@ -72,13 +72,10 @@ module.exports = {
for (var i = 0, len = tests.length; i < len; ++i) {
var str = tests[i++]
, obj = tests[i]
, got = parseFont(str);
, actual = parseFont(str);
if (!obj.style) obj.style = 'normal';
if (!obj.weight) obj.weight = 'normal';
assert.eql(obj, got, ''
+ '\n from: ' + sys.inspect(str)
+ '\n got:\n' + sys.inspect(got)
+ '\n expected:\n' + sys.inspect(obj));
actual.should.eql(obj);
}
},
View
@@ -14,7 +14,7 @@ module.exports = {
assert.ok(Image instanceof Function);
},
'test Image#onload': function(beforeExit){
'test Image#onload': function(){
var img = new Image
, n = 0;
@@ -27,16 +27,14 @@ module.exports = {
img.src = png;
assert.equal(img.src, png);
beforeExit(function(){
assert.equal(img.src, png);
assert.strictEqual(true, img.complete);
assert.strictEqual(320, img.width);
assert.strictEqual(320, img.height);
assert.equal(1, n);
});
assert.equal(img.src, png);
assert.strictEqual(true, img.complete);
assert.strictEqual(320, img.width);
assert.strictEqual(320, img.height);
assert.equal(1, n);
},
'test Image#onerror': function(beforeExit){
'test Image#onerror': function(){
var img = new Image
, error
, n = 0;
@@ -59,14 +57,12 @@ module.exports = {
assert.equal(img.src, png + 's');
beforeExit(function(){
assert.ok(error instanceof Error, 'did not invoke onerror() with error');
assert.strictEqual(false, img.complete);
assert.equal(1, n);
});
assert.ok(error instanceof Error, 'did not invoke onerror() with error');
assert.strictEqual(false, img.complete);
assert.equal(1, n);
},
'test Image#{width,height}': function(beforeExit){
'test Image#{width,height}': function(){
var img = new Image
, n = 0;
@@ -79,8 +75,6 @@ module.exports = {
};
img.src = png;
beforeExit(function(){
assert.equal(1, n);
});
assert.equal(1, n);
}
};

0 comments on commit 078a857

Please sign in to comment.