From 24025b45d9b044bb3e5478355467cc85bac5d25e Mon Sep 17 00:00:00 2001 From: Lloyd Brookes Date: Sun, 9 Oct 2016 23:14:27 +0100 Subject: [PATCH] more tests --- es5/test/async.js | 17 +++++++++++------ package.json | 2 +- src/test/async.js | 19 +++++++++++++++---- 3 files changed, 27 insertions(+), 11 deletions(-) diff --git a/es5/test/async.js b/es5/test/async.js index 9f73ed5a..ed6df9b9 100644 --- a/es5/test/async.js +++ b/es5/test/async.js @@ -7,12 +7,7 @@ var fs = require('fs'); try { fs.mkdirSync('tmp-test'); } catch (err) {} -jsdoc2md._usage.defaults.set('tid', 'UA-70853320-4'); -jsdoc2md._usage.queuePath = 'tmp-test/unsent.json'; -jsdoc2md._usage._lastSentPath = 'tmp-test/lastSent.json'; -process.on('beforeExit', function () { - return jsdoc2md._usage.send(); -}); +jsdoc2md._usage.disable(); var runner = new TestRunner(); var inputFile = 'src/test/fixture/ignore.js'; @@ -141,4 +136,14 @@ runner.test('.getJsdocData({ files, noCache })', function () { return jsdoc2md.getJsdocData({ files: inputFile, noCache: true }).then(function (result) { return a.ok(result[0].longname); }); +}); + +runner.test('.getNamepaths()', function () { + return jsdoc2md.getNamepaths({ files: 'src/test/fixture/ignore.js' }).then(function (namepaths) { + a.deepStrictEqual(namepaths.member, ['visible', 'invisible']); + }); +}); + +runner.test('.clear()', function () { + return jsdoc2md.clear(); }); \ No newline at end of file diff --git a/package.json b/package.json index 4bf24394..1cf386e1 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "devDependencies": { "babel-preset-es2015": "^6.16.0", "coveralls": "^2.11.14", - "test-runner": "^0.2.4" + "test-runner": "^0.2.5" }, "standard": { "ignore": [ diff --git a/src/test/async.js b/src/test/async.js index da75f14b..af7773ac 100644 --- a/src/test/async.js +++ b/src/test/async.js @@ -8,10 +8,7 @@ try { } catch (err) { // exists } -jsdoc2md._usage.defaults.set('tid', 'UA-70853320-4') -jsdoc2md._usage.queuePath = 'tmp-test/unsent.json' -jsdoc2md._usage._lastSentPath = 'tmp-test/lastSent.json' -process.on('beforeExit', () => jsdoc2md._usage.send()) +jsdoc2md._usage.disable() const runner = new TestRunner() const inputFile = 'src/test/fixture/ignore.js' @@ -135,3 +132,17 @@ runner.test('.getJsdocData({ files, noCache })', function () { return jsdoc2md.getJsdocData({ files: inputFile, noCache: true }) .then(result => a.ok(result[0].longname)) }) + +runner.test('.getNamepaths()', function () { + return jsdoc2md.getNamepaths({ files: 'src/test/fixture/ignore.js' }) + .then(namepaths => { + a.deepStrictEqual(namepaths.member, [ + 'visible', + 'invisible' + ]) + }) +}) + +runner.test('.clear()', function () { + return jsdoc2md.clear() +})