Skip to content

Commit 13fedc6

Browse files
author
Todd Wolfson
committed
Added multi-engine to tests and bumped version number
1 parent e7575ed commit 13fedc6

File tree

5 files changed

+7
-5
lines changed

5 files changed

+7
-5
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "grunt-spritesmith",
3-
"version": "0.0.1",
3+
"version": "0.0.2",
44
"description": "Grunt library for using spritesmith",
55
"main": "index.js",
66
"scripts": {

src-test/expected_files/gm.png

5.36 KB
Loading

src-test/grunt-spritesmith.test.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@ module.exports = {
44
spritesmith: function (test) {
55
// Load in the images
66
// TODO: If this were BDD, we should be loading this into a canvas and doing a threshold comparison there (i.e. are the images 90% similar)
7-
var expectedImage = fs.readFileSync(__dirname + '/expected_files/sprite.png', 'binary'),
8-
actualImage = fs.readFileSync(__dirname + '/scratch/sprite.png', 'binary');
7+
var expectedCanvasImage = fs.readFileSync(__dirname + '/expected_files/canvas.png', 'binary'),
8+
expectedGmImage = fs.readFileSync(__dirname + '/expected_files/gm.png', 'binary'),
9+
actualImage = fs.readFileSync(__dirname + '/scratch/sprite.png', 'binary'),
10+
matchesImage = expectedCanvasImage === actualImage || expectedGmImage === actualImage;
911

1012
// Assert they are equal
11-
test.strictEqual(expectedImage, actualImage, 'Actual image does not match expected image');
13+
test.ok(actualImage, 'Actual image does not match expected image');
1214

1315
// Load in the sprite positions
1416
// TODO: If this were BDD, we would be asserting the same variables exist -- which means loading this into either Stylus or a meta-language

src/grunt-spritesmith.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ module.exports = function (grunt) {
2222
var cb = this.async();
2323

2424
// Run through spritesmith
25-
spritesmith(srcFiles, function (err, result) {
25+
spritesmith(srcFiles, {}, function (err, result) {
2626
// If an error occurred, callback with it
2727
if (err) {
2828
return cb(err);

0 commit comments

Comments
 (0)