mirror of
https://github.com/documentationjs/documentation.git
synced 2026-01-25 14:26:29 +00:00
Add tests
* Add shallow test case * Add polyglot test case
This commit is contained in:
parent
9f3bc54ce0
commit
d3fcd4ae9e
17
test/streams/polyglot.js
Normal file
17
test/streams/polyglot.js
Normal file
@ -0,0 +1,17 @@
|
||||
'use strict';
|
||||
|
||||
var test = require('prova'),
|
||||
concat = require('concat-stream'),
|
||||
path = require('path'),
|
||||
shallow = require('../../streams/shallow'),
|
||||
polyglot = require('../../streams/polyglot');
|
||||
|
||||
test('polyglot', function (t) {
|
||||
shallow([path.resolve(path.join(__dirname, '../fixture/polyglot/blend.cpp'))])
|
||||
.pipe(polyglot())
|
||||
.pipe(concat(function (comments) {
|
||||
t.equal(comments.length, 1);
|
||||
t.equal(comments[0].description, 'This method moves a hex to a color');
|
||||
t.end();
|
||||
}));
|
||||
});
|
||||
26
test/streams/shallow.js
Normal file
26
test/streams/shallow.js
Normal file
@ -0,0 +1,26 @@
|
||||
'use strict';
|
||||
|
||||
var test = require('prova'),
|
||||
concat = require('concat-stream'),
|
||||
path = require('path'),
|
||||
shallow = require('../../streams/shallow');
|
||||
|
||||
test('shallow deps', function (t) {
|
||||
shallow([path.resolve(path.join(__dirname, '../fixture/es6.input.js'))])
|
||||
.pipe(concat(function (deps) {
|
||||
t.equal(deps.length, 1);
|
||||
t.ok(deps[0].file, 'has file');
|
||||
t.end();
|
||||
}));
|
||||
});
|
||||
|
||||
test('shallow deps multi', function (t) {
|
||||
shallow([
|
||||
path.resolve(path.join(__dirname, '../fixture/es6.input.js')),
|
||||
path.resolve(path.join(__dirname, '../fixture/es6.output.json'))
|
||||
]).pipe(concat(function (deps) {
|
||||
t.equal(deps.length, 2);
|
||||
t.ok(deps[0].file, 'has file');
|
||||
t.end();
|
||||
}));
|
||||
});
|
||||
Loading…
x
Reference in New Issue
Block a user