2015-03-10 17:56:43 -07:00

29 lines
809 B
JavaScript

var test = require('tape'),
documentation = require('../'),
path = require('path'),
concat = require('concat-stream'),
chdir = require('chdir');
test('documentation', function (t) {
documentation(path.join(__dirname, 'fixture/simple.js')).pipe(concat(function (data) {
t.equal(data.length, 1, 'simple has no dependencies');
t.end();
}));
});
test('skips external dependencies', function (t) {
documentation(path.join(__dirname, 'fixture/external.js')).pipe(concat(function (data) {
t.equal(data.length, 0);
t.end();
}));
});
test('accepts simple relative paths', function (t) {
chdir(__dirname, function() {
documentation('fixture/simple.js').pipe(concat(function (data) {
t.equal(data.length, 1, 'simple has no dependencies');
t.end();
}));
});
});