From 61232dda587d5dd991820a0a3377da775f577201 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Tue, 25 Jul 2017 05:54:59 -0400 Subject: [PATCH] Fix tests --- package.json | 2 +- test.js | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index 893179f..42cee95 100644 --- a/package.json +++ b/package.json @@ -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" }, diff --git a/test.js b/test.js index cd22488..2313cd4 100644 --- a/test.js +++ b/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) { @@ -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); } @@ -64,12 +64,12 @@ 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", @@ -77,7 +77,7 @@ test.only('alphamap values are computed independently between runs', function(t) 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();