mirror of
https://github.com/documentationjs/documentation.git
synced 2025-12-08 18:23:43 +00:00
29 lines
809 B
JavaScript
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();
|
|
}));
|
|
});
|
|
});
|