From 68096e78cd9fb2d88f296ad6d851d5f667e83d4e Mon Sep 17 00:00:00 2001 From: Lars-Magnus Skog Date: Tue, 28 Apr 2015 17:56:30 +0200 Subject: [PATCH] change from tap to tape --- package.json | 10 +++--- test.js | 92 ++++++++++++++++++++++++++-------------------------- 2 files changed, 51 insertions(+), 51 deletions(-) diff --git a/package.json b/package.json index 24de8b09..db7c2583 100644 --- a/package.json +++ b/package.json @@ -30,18 +30,18 @@ ], "main": "./abstract-leveldown.js", "dependencies": { - "xtend": "~3.0.0" + "xtend": "~4.0.0" }, "devDependencies": { - "tap": "*", - "sinon": "*", - "rimraf": "*" + "rimraf": "~2.3.2", + "sinon": "~1.14.1", + "tape": "~4.0.0" }, "browser": { "rimraf": false }, "scripts": { - "test": "node ./test.js" + "test": "node test.js" }, "license": "MIT" } diff --git a/test.js b/test.js index 80d906ad..7aef43c0 100644 --- a/test.js +++ b/test.js @@ -1,4 +1,4 @@ -const tap = require('tap') +const test = require('tape') , sinon = require('sinon') , util = require('util') , testCommon = require('./testCommon') @@ -12,44 +12,44 @@ function factory (location) { /*** compatibility with basic LevelDOWN API ***/ -require('./abstract/leveldown-test').args(factory, tap.test, testCommon) +require('./abstract/leveldown-test').args(factory, test, testCommon) -require('./abstract/open-test').args(factory, tap.test, testCommon) +require('./abstract/open-test').args(factory, test, testCommon) -require('./abstract/del-test').setUp(factory, tap.test, testCommon) -require('./abstract/del-test').args(tap.test) +require('./abstract/del-test').setUp(factory, test, testCommon) +require('./abstract/del-test').args(test) -require('./abstract/get-test').setUp(factory, tap.test, testCommon) -require('./abstract/get-test').args(tap.test) +require('./abstract/get-test').setUp(factory, test, testCommon) +require('./abstract/get-test').args(test) -require('./abstract/put-test').setUp(factory, tap.test, testCommon) -require('./abstract/put-test').args(tap.test) +require('./abstract/put-test').setUp(factory, test, testCommon) +require('./abstract/put-test').args(test) -require('./abstract/put-get-del-test').setUp(factory, tap.test, testCommon) -require('./abstract/put-get-del-test').errorKeys(tap.test) -//require('./abstract/put-get-del-test').nonErrorKeys(tap.test, testCommon) -require('./abstract/put-get-del-test').errorValues(tap.test) -//require('./abstract/test/put-get-del-test').nonErrorKeys(tap.test, testCommon) -require('./abstract/put-get-del-test').tearDown(tap.test, testCommon) +require('./abstract/put-get-del-test').setUp(factory, test, testCommon) +require('./abstract/put-get-del-test').errorKeys(test) +//require('./abstract/put-get-del-test').nonErrorKeys(test, testCommon) +require('./abstract/put-get-del-test').errorValues(test) +//require('./abstract/test/put-get-del-test').nonErrorKeys(test, testCommon) +require('./abstract/put-get-del-test').tearDown(test, testCommon) -require('./abstract/approximate-size-test').setUp(factory, tap.test, testCommon) -require('./abstract/approximate-size-test').args(tap.test) +require('./abstract/approximate-size-test').setUp(factory, test, testCommon) +require('./abstract/approximate-size-test').args(test) -require('./abstract/batch-test').setUp(factory, tap.test, testCommon) -require('./abstract/batch-test').args(tap.test) +require('./abstract/batch-test').setUp(factory, test, testCommon) +require('./abstract/batch-test').args(test) -require('./abstract/chained-batch-test').setUp(factory, tap.test, testCommon) -require('./abstract/chained-batch-test').args(tap.test) +require('./abstract/chained-batch-test').setUp(factory, test, testCommon) +require('./abstract/chained-batch-test').args(test) -require('./abstract/close-test').close(factory, tap.test, testCommon) +require('./abstract/close-test').close(factory, test, testCommon) -require('./abstract/iterator-test').setUp(factory, tap.test, testCommon) -require('./abstract/iterator-test').args(tap.test) -require('./abstract/iterator-test').sequence(tap.test) +require('./abstract/iterator-test').setUp(factory, test, testCommon) +require('./abstract/iterator-test').args(test) +require('./abstract/iterator-test').sequence(test) /*** extensibility ***/ -tap.test('test core extensibility', function (t) { +test('test core extensibility', function (t) { function Test (location) { AbstractLevelDOWN.call(this, location) t.equal(this.location, location, 'location set on `this`') @@ -61,7 +61,7 @@ tap.test('test core extensibility', function (t) { ;new Test('foobar') }) -tap.test('test open() extensibility', function (t) { +test('test open() extensibility', function (t) { var spy = sinon.spy() , expectedCb = function () {} , expectedOptions = { createIfMissing: true, errorIfExists: false } @@ -96,7 +96,7 @@ tap.test('test open() extensibility', function (t) { t.end() }) -tap.test('test close() extensibility', function (t) { +test('test close() extensibility', function (t) { var spy = sinon.spy() , expectedCb = function () {} , test @@ -119,7 +119,7 @@ tap.test('test close() extensibility', function (t) { t.end() }) -tap.test('test get() extensibility', function (t) { +test('test get() extensibility', function (t) { var spy = sinon.spy() , expectedCb = function () {} , expectedOptions = { asBuffer: true } @@ -157,7 +157,7 @@ tap.test('test get() extensibility', function (t) { t.end() }) -tap.test('test del() extensibility', function (t) { +test('test del() extensibility', function (t) { var spy = sinon.spy() , expectedCb = function () {} , expectedOptions = { options: 1 } @@ -193,7 +193,7 @@ tap.test('test del() extensibility', function (t) { t.end() }) -tap.test('test put() extensibility', function (t) { +test('test put() extensibility', function (t) { var spy = sinon.spy() , expectedCb = function () {} , expectedOptions = { options: 1 } @@ -232,7 +232,7 @@ tap.test('test put() extensibility', function (t) { t.end() }) -tap.test('test approximateSize() extensibility', function (t) { +test('test approximateSize() extensibility', function (t) { var spy = sinon.spy() , expectedCb = function () {} , expectedStart = 'a start' @@ -259,7 +259,7 @@ tap.test('test approximateSize() extensibility', function (t) { t.end() }) -tap.test('test batch() extensibility', function (t) { +test('test batch() extensibility', function (t) { var spy = sinon.spy() , expectedCb = function () {} , expectedOptions = { options: 1 } @@ -305,7 +305,7 @@ tap.test('test batch() extensibility', function (t) { t.end() }) -tap.test('test chained batch() (array) extensibility', function (t) { +test('test chained batch() (array) extensibility', function (t) { var spy = sinon.spy() , expectedCb = function () {} , expectedOptions = { options: 1 } @@ -347,7 +347,7 @@ tap.test('test chained batch() (array) extensibility', function (t) { t.end() }) -tap.test('test chained batch() (custom _chainedBatch) extensibility', function (t) { +test('test chained batch() (custom _chainedBatch) extensibility', function (t) { var spy = sinon.spy() , test @@ -374,7 +374,7 @@ tap.test('test chained batch() (custom _chainedBatch) extensibility', function ( t.end() }) -tap.test('test AbstractChainedBatch extensibility', function (t) { +test('test AbstractChainedBatch extensibility', function (t) { function Test (db) { AbstractChainedBatch.call(this, db) t.equal(this._db, db, 'db set on `this`') @@ -386,7 +386,7 @@ tap.test('test AbstractChainedBatch extensibility', function (t) { new Test('foobar') }) -tap.test('test write() extensibility', function (t) { +test('test write() extensibility', function (t) { var spy = sinon.spy() , spycb = sinon.spy() , test @@ -406,14 +406,14 @@ tap.test('test write() extensibility', function (t) { t.equal(spy.getCall(0).thisValue, test, '`this` on _write() was correct') t.equal(spy.getCall(0).args.length, 1, 'got one argument') // awkward here cause of nextTick & an internal wrapped cb - t.type(spy.getCall(0).args[0], 'function', 'got a callback function') + t.equal(typeof spy.getCall(0).args[0], 'function', 'got a callback function') t.equal(spycb.callCount, 0, 'spycb not called') spy.getCall(0).args[0]() t.equal(spycb.callCount, 1, 'spycb called, i.e. was our cb argument') t.end() }) -tap.test('test put() extensibility', function (t) { +test('test put() extensibility', function (t) { var spy = sinon.spy() , expectedKey = 'key' , expectedValue = 'value' @@ -439,7 +439,7 @@ tap.test('test put() extensibility', function (t) { t.end() }) -tap.test('test del() extensibility', function (t) { +test('test del() extensibility', function (t) { var spy = sinon.spy() , expectedKey = 'key' , returnValue @@ -463,7 +463,7 @@ tap.test('test del() extensibility', function (t) { t.end() }) -tap.test('test clear() extensibility', function (t) { +test('test clear() extensibility', function (t) { var spy = sinon.spy() , returnValue , test @@ -485,7 +485,7 @@ tap.test('test clear() extensibility', function (t) { t.end() }) -tap.test('test iterator() extensibility', function (t) { +test('test iterator() extensibility', function (t) { var spy = sinon.spy() , expectedOptions = { options: 1, reverse: false, keys: true, values: true, limit: -1, keyAsBuffer: true, valueAsBuffer: true } , test @@ -508,7 +508,7 @@ tap.test('test iterator() extensibility', function (t) { t.end() }) -tap.test('test AbstractIterator extensibility', function (t) { +test('test AbstractIterator extensibility', function (t) { function Test (db) { AbstractIterator.call(this, db) t.equal(this.db, db, 'db set on `this`') @@ -520,7 +520,7 @@ tap.test('test AbstractIterator extensibility', function (t) { ;new Test('foobar') }) -tap.test('test next() extensibility', function (t) { +test('test next() extensibility', function (t) { var spy = sinon.spy() , spycb = sinon.spy() , test @@ -540,14 +540,14 @@ tap.test('test next() extensibility', function (t) { t.equal(spy.getCall(0).thisValue, test, '`this` on _next() was correct') t.equal(spy.getCall(0).args.length, 1, 'got one arguments') // awkward here cause of nextTick & an internal wrapped cb - t.type(spy.getCall(0).args[0], 'function', 'got a callback function') + t.equal(typeof spy.getCall(0).args[0], 'function', 'got a callback function') t.equal(spycb.callCount, 0, 'spycb not called') spy.getCall(0).args[0]() t.equal(spycb.callCount, 1, 'spycb called, i.e. was our cb argument') t.end() }) -tap.test('test end() extensibility', function (t) { +test('test end() extensibility', function (t) { var spy = sinon.spy() , expectedCb = function () {} , test