diff --git a/test/streams/polyglot.js b/test/streams/polyglot.js new file mode 100644 index 0000000..82aa8e0 --- /dev/null +++ b/test/streams/polyglot.js @@ -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(); + })); +}); diff --git a/test/streams/shallow.js b/test/streams/shallow.js new file mode 100644 index 0000000..a2ccdec --- /dev/null +++ b/test/streams/shallow.js @@ -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(); + })); +});