Skip to content

Commit

Permalink
more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
75lb committed Oct 9, 2016
1 parent a4530a0 commit 24025b4
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 11 deletions.
17 changes: 11 additions & 6 deletions es5/test/async.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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();
});
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
19 changes: 15 additions & 4 deletions src/test/async.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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()
})

0 comments on commit 24025b4

Please sign in to comment.