Convert tests to use tape/istanbul/faucet

This commit is contained in:
Patrick Mooney 2014-07-08 14:31:57 -05:00
parent ee83d0e3ee
commit 3186f5eca1
45 changed files with 82 additions and 49 deletions

1
.gitignore vendored
View File

@ -1,5 +1,6 @@
build build
node_modules node_modules
coverage
*.log *.log
*.ldif *.ldif
*.tar.* *.tar.*

View File

@ -39,7 +39,7 @@ JSL_FILES_NODE = $(JS_FILES)
JSSTYLE_FILES = $(JS_FILES) JSSTYLE_FILES = $(JS_FILES)
JSSTYLE_FLAGS = -f tools/jsstyle.conf JSSTYLE_FLAGS = -f tools/jsstyle.conf
CLEAN_FILES += node_modules $(SHRINKWRAP) cscope.files CLEAN_FILES += node_modules coverage $(SHRINKWRAP) cscope.files
include ./tools/mk/Makefile.defs include ./tools/mk/Makefile.defs
@ -56,10 +56,11 @@ CLEAN_FILES += $(TAP) ./node_modules/tap
.PHONY: test .PHONY: test
test: $(TAP) test: $(TAP)
$(TAP) test/*.test.js $(NPM) test
$(TAP) test/filters/*.test.js
$(TAP) test/controls/*.test.js .PHONY: cover
$(TAP) test/messages/*.test.js cover: test
$(NPM) run report
include ./tools/mk/Makefile.deps include ./tools/mk/Makefile.deps
include ./tools/mk/Makefile.targ include ./tools/mk/Makefile.targ

View File

@ -39,10 +39,13 @@
"dtrace-provider": "0.2.8" "dtrace-provider": "0.2.8"
}, },
"devDependencies": { "devDependencies": {
"tap": "0.4.1", "node-uuid": "1.4.0",
"node-uuid": "1.4.0" "faucet": "0.0.1",
"istanbul": "0.3.0",
"tape": "2.13.3"
}, },
"scripts": { "scripts": {
"test": "./node_modules/.bin/tap ./test" "report": "./node_modules/.bin/istanbul report html && open ./coverage/lcov-report/index.html",
"test": "./node_modules/.bin/istanbul cover --print none test/test.js | ./node_modules/.bin/faucet"
} }
} }

View File

@ -1,6 +1,6 @@
// Copyright 2011 Mark Cavage, Inc. All rights reserved. // Copyright 2011 Mark Cavage, Inc. All rights reserved.
var test = require('tap').test; var test = require('tape').test;
var asn1 = require('asn1'); var asn1 = require('asn1');

View File

@ -1,6 +1,6 @@
// Copyright 2011 Mark Cavage, Inc. All rights reserved. // Copyright 2011 Mark Cavage, Inc. All rights reserved.
var test = require('tap').test; var test = require('tape').test;
var asn1 = require('asn1'); var asn1 = require('asn1');

View File

@ -2,7 +2,7 @@
var Logger = require('bunyan'); var Logger = require('bunyan');
var test = require('tap').test; var test = require('tape').test;
var uuid = require('node-uuid'); var uuid = require('node-uuid');
var vasync = require('vasync'); var vasync = require('vasync');

View File

@ -1,6 +1,6 @@
// Copyright 2011 Mark Cavage, Inc. All rights reserved. // Copyright 2011 Mark Cavage, Inc. All rights reserved.
var test = require('tap').test; var test = require('tape').test;
var asn1 = require('asn1'); var asn1 = require('asn1');

View File

@ -1,6 +1,6 @@
// Copyright 2011 Mark Cavage, Inc. All rights reserved. // Copyright 2011 Mark Cavage, Inc. All rights reserved.
var test = require('tap').test; var test = require('tape').test;
var asn1 = require('asn1'); var asn1 = require('asn1');

View File

@ -1,5 +1,5 @@
var test = require('tap').test; var test = require('tape').test;
var asn1 = require('asn1'); var asn1 = require('asn1');

View File

@ -1,4 +1,4 @@
var test = require('tap').test; var test = require('tape').test;
var asn1 = require('asn1'); var asn1 = require('asn1');

View File

@ -1,6 +1,6 @@
// Copyright 2011 Mark Cavage, Inc. All rights reserved. // Copyright 2011 Mark Cavage, Inc. All rights reserved.
var test = require('tap').test; var test = require('tape').test;

View File

@ -1,6 +1,6 @@
// Copyright 2011 Mark Cavage, Inc. All rights reserved. // Copyright 2011 Mark Cavage, Inc. All rights reserved.
var test = require('tap').test; var test = require('tape').test;
var asn1 = require('asn1'); var asn1 = require('asn1');

View File

@ -1,6 +1,6 @@
// Copyright 2011 Mark Cavage, Inc. All rights reserved. // Copyright 2011 Mark Cavage, Inc. All rights reserved.
var test = require('tap').test; var test = require('tape').test;
var asn1 = require('asn1'); var asn1 = require('asn1');

View File

@ -1,6 +1,6 @@
// Copyright 2011 Mark Cavage, Inc. All rights reserved. // Copyright 2011 Mark Cavage, Inc. All rights reserved.
var test = require('tap').test; var test = require('tape').test;
var asn1 = require('asn1'); var asn1 = require('asn1');

View File

@ -1,6 +1,6 @@
// Copyright 2011 Mark Cavage, Inc. All rights reserved. // Copyright 2011 Mark Cavage, Inc. All rights reserved.
var test = require('tap').test; var test = require('tape').test;
var asn1 = require('asn1'); var asn1 = require('asn1');

View File

@ -1,6 +1,6 @@
// Copyright 2011 Mark Cavage, Inc. All rights reserved. // Copyright 2011 Mark Cavage, Inc. All rights reserved.
var test = require('tap').test; var test = require('tape').test;
///--- Globals ///--- Globals

View File

@ -1,6 +1,6 @@
// Copyright 2011 Mark Cavage, Inc. All rights reserved. // Copyright 2011 Mark Cavage, Inc. All rights reserved.
var test = require('tap').test; var test = require('tape').test;
var asn1 = require('asn1'); var asn1 = require('asn1');

View File

@ -1,6 +1,6 @@
// Copyright 2011 Mark Cavage, Inc. All rights reserved. // Copyright 2011 Mark Cavage, Inc. All rights reserved.
var test = require('tap').test; var test = require('tape').test;
var asn1 = require('asn1'); var asn1 = require('asn1');

View File

@ -1,6 +1,6 @@
// Copyright 2011 Mark Cavage, Inc. All rights reserved. // Copyright 2011 Mark Cavage, Inc. All rights reserved.
var test = require('tap').test; var test = require('tape').test;
var asn1 = require('asn1'); var asn1 = require('asn1');

View File

@ -1,6 +1,6 @@
// Copyright 2011 Mark Cavage, Inc. All rights reserved. // Copyright 2011 Mark Cavage, Inc. All rights reserved.
var test = require('tap').test; var test = require('tape').test;
var asn1 = require('asn1'); var asn1 = require('asn1');

View File

@ -1,6 +1,6 @@
// Copyright 2011 Mark Cavage, Inc. All rights reserved. // Copyright 2011 Mark Cavage, Inc. All rights reserved.
var test = require('tap').test; var test = require('tape').test;
var parse = require('../../lib/index').parseFilter; var parse = require('../../lib/index').parseFilter;

View File

@ -1,6 +1,6 @@
// Copyright 2011 Mark Cavage, Inc. All rights reserved. // Copyright 2011 Mark Cavage, Inc. All rights reserved.
var test = require('tap').test; var test = require('tape').test;
var asn1 = require('asn1'); var asn1 = require('asn1');

View File

@ -1,6 +1,6 @@
// Copyright 2011 Mark Cavage, Inc. All rights reserved. // Copyright 2011 Mark Cavage, Inc. All rights reserved.
var test = require('tap').test; var test = require('tape').test;
var asn1 = require('asn1'); var asn1 = require('asn1');

View File

@ -1,6 +1,6 @@
// Copyright 2011 Mark Cavage, Inc. All rights reserved. // Copyright 2011 Mark Cavage, Inc. All rights reserved.
var test = require('tap').test; var test = require('tape').test;
var uuid = require('node-uuid'); var uuid = require('node-uuid');
var ldap = require('../lib/index'); var ldap = require('../lib/index');

View File

@ -1,6 +1,6 @@
// Copyright 2011 Mark Cavage, Inc. All rights reserved. // Copyright 2011 Mark Cavage, Inc. All rights reserved.
var test = require('tap').test; var test = require('tape').test;
var asn1 = require('asn1'); var asn1 = require('asn1');

View File

@ -1,6 +1,6 @@
// Copyright 2011 Mark Cavage, Inc. All rights reserved. // Copyright 2011 Mark Cavage, Inc. All rights reserved.
var test = require('tap').test; var test = require('tape').test;
var asn1 = require('asn1'); var asn1 = require('asn1');

View File

@ -1,6 +1,6 @@
// Copyright 2011 Mark Cavage, Inc. All rights reserved. // Copyright 2011 Mark Cavage, Inc. All rights reserved.
var test = require('tap').test; var test = require('tape').test;
var asn1 = require('asn1'); var asn1 = require('asn1');

View File

@ -1,6 +1,6 @@
// Copyright 2011 Mark Cavage, Inc. All rights reserved. // Copyright 2011 Mark Cavage, Inc. All rights reserved.
var test = require('tap').test; var test = require('tape').test;
var asn1 = require('asn1'); var asn1 = require('asn1');

View File

@ -1,6 +1,6 @@
// Copyright 2011 Mark Cavage, Inc. All rights reserved. // Copyright 2011 Mark Cavage, Inc. All rights reserved.
var test = require('tap').test; var test = require('tape').test;
var asn1 = require('asn1'); var asn1 = require('asn1');

View File

@ -1,6 +1,6 @@
// Copyright 2011 Mark Cavage, Inc. All rights reserved. // Copyright 2011 Mark Cavage, Inc. All rights reserved.
var test = require('tap').test; var test = require('tape').test;
var asn1 = require('asn1'); var asn1 = require('asn1');

View File

@ -3,7 +3,7 @@
var asn1 = require('asn1'); var asn1 = require('asn1');
var Logger = require('bunyan'); var Logger = require('bunyan');
var test = require('tap').test; var test = require('tape').test;
///--- Globals ///--- Globals

View File

@ -1,6 +1,6 @@
// Copyright 2011 Mark Cavage, Inc. All rights reserved. // Copyright 2011 Mark Cavage, Inc. All rights reserved.
var test = require('tap').test; var test = require('tape').test;
var asn1 = require('asn1'); var asn1 = require('asn1');

View File

@ -1,6 +1,6 @@
// Copyright 2011 Mark Cavage, Inc. All rights reserved. // Copyright 2011 Mark Cavage, Inc. All rights reserved.
var test = require('tap').test; var test = require('tape').test;
var asn1 = require('asn1'); var asn1 = require('asn1');

View File

@ -1,6 +1,6 @@
// Copyright 2011 Mark Cavage, Inc. All rights reserved. // Copyright 2011 Mark Cavage, Inc. All rights reserved.
var test = require('tap').test; var test = require('tape').test;
var asn1 = require('asn1'); var asn1 = require('asn1');

View File

@ -1,6 +1,6 @@
// Copyright 2011 Mark Cavage, Inc. All rights reserved. // Copyright 2011 Mark Cavage, Inc. All rights reserved.
var test = require('tap').test; var test = require('tape').test;
var asn1 = require('asn1'); var asn1 = require('asn1');

View File

@ -1,6 +1,6 @@
// Copyright 2011 Mark Cavage, Inc. All rights reserved. // Copyright 2011 Mark Cavage, Inc. All rights reserved.
var test = require('tap').test; var test = require('tape').test;
var asn1 = require('asn1'); var asn1 = require('asn1');

View File

@ -1,6 +1,6 @@
// Copyright 2011 Mark Cavage, Inc. All rights reserved. // Copyright 2011 Mark Cavage, Inc. All rights reserved.
var test = require('tap').test; var test = require('tape').test;
var asn1 = require('asn1'); var asn1 = require('asn1');

View File

@ -1,6 +1,6 @@
// Copyright 2011 Mark Cavage, Inc. All rights reserved. // Copyright 2011 Mark Cavage, Inc. All rights reserved.
var test = require('tap').test; var test = require('tape').test;
var asn1 = require('asn1'); var asn1 = require('asn1');

View File

@ -1,6 +1,6 @@
// Copyright 2011 Mark Cavage, Inc. All rights reserved. // Copyright 2011 Mark Cavage, Inc. All rights reserved.
var test = require('tap').test; var test = require('tape').test;
var asn1 = require('asn1'); var asn1 = require('asn1');

View File

@ -1,6 +1,6 @@
// Copyright 2011 Mark Cavage, Inc. All rights reserved. // Copyright 2011 Mark Cavage, Inc. All rights reserved.
var test = require('tap').test; var test = require('tape').test;
var asn1 = require('asn1'); var asn1 = require('asn1');

View File

@ -1,6 +1,6 @@
// Copyright 2011 Mark Cavage, Inc. All rights reserved. // Copyright 2011 Mark Cavage, Inc. All rights reserved.
var test = require('tap').test; var test = require('tape').test;
var asn1 = require('asn1'); var asn1 = require('asn1');

View File

@ -1,6 +1,6 @@
// Copyright 2011 Mark Cavage, Inc. All rights reserved. // Copyright 2011 Mark Cavage, Inc. All rights reserved.
var test = require('tap').test; var test = require('tape').test;
var asn1 = require('asn1'); var asn1 = require('asn1');

View File

@ -2,7 +2,7 @@
var Logger = require('bunyan'); var Logger = require('bunyan');
var test = require('tap').test; var test = require('tape').test;
var uuid = require('node-uuid'); var uuid = require('node-uuid');
var vasync = require('vasync'); var vasync = require('vasync');

28
test/test.js Normal file
View File

@ -0,0 +1,28 @@
// Copyright 2014 Mark Cavage. All rights reserved.
var assert = require('assert');
var fs = require('fs');
var path = require('path');
function runTests(directory) {
fs.readdir(directory, function (err, files) {
assert.ifError(err);
console.dir(files);
files.filter(function (f) {
return (/\.test\.js$/.test(f));
}).map(function (f) {
return (path.join(directory, f));
}).forEach(require);
});
}
///--- Run All Tests
(function main() {
runTests(__dirname);
runTests(path.join(__dirname, 'controls'));
runTests(path.join(__dirname, 'filters'));
runTests(path.join(__dirname, 'messages'));
})();

View File

@ -1,6 +1,6 @@
// Copyright 2011 Mark Cavage, Inc. All rights reserved. // Copyright 2011 Mark Cavage, Inc. All rights reserved.
var test = require('tap').test; var test = require('tape').test;