Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dy committed Jul 25, 2017
1 parent 26dcc74 commit 61232dd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -14,7 +14,7 @@
},
"main": "index.js",
"scripts": {
"test": "tape test/*.js",
"test": "node test.js",
"build": "browserify example/example.js -o example/bundle.js",
"draw": "budo test/draw.js"
},
Expand Down
20 changes: 10 additions & 10 deletions test.js
@@ -1,5 +1,5 @@
var colormap = require('../.'),
test = require('tape').test;
var colormap = require('.'),
test = require('tape');


test('is object - object', function(t) {
Expand All @@ -13,7 +13,7 @@ test('is object - object', function(t) {
'winter', 'greys', 'bone', 'copper'];

for (var i = 0; i < cms.length; i++) {
cg = cmap({'colormap': cms[i], 'nshades': n });
cg = colormap({'colormap': cms[i], 'nshades': n });
check = check & (cg.length == n);
}

Expand Down Expand Up @@ -64,20 +64,20 @@ test('user colormap alpha values override alpha config', function (t) {
t.end();
});

test.only('alphamap values are computed independently between runs', function(t) {
// var blueRed = colormap({
// colormap: "bluered",
// format: "rgba",
// alpha: [0, 1]
// });
test('alphamap values are computed independently between runs', function(t) {
var blueRed = colormap({
colormap: "bluered",
format: "rgba",
alpha: [0, 1]
});

var blueRed2 = colormap({
colormap: "bluered",
format: "rgba",
alpha: [0, 0.5]
});

// t.same(blueRed[blueRed.length - 1], [ 255, 0, 0, 1 ]);
t.same(blueRed[blueRed.length - 1], [ 255, 0, 0, 1 ]);
t.same(blueRed2[blueRed2.length - 1], [ 255, 0, 0, 0.5 ]);

t.end();
Expand Down

0 comments on commit 61232dd

Please sign in to comment.