cycle.js 558 B

12345678910111213141516171819
  1. var mdeps = require('../');
  2. var test = require('tap').test;
  3. var JSONStream = require('JSONStream');
  4. var packer = require('browser-pack');
  5. var concat = require('concat-stream');
  6. var path = require('path');
  7. test('cycle', function (t) {
  8. t.plan(1);
  9. var p = mdeps();
  10. p.end(path.join(__dirname, '/cycle/main.js'));
  11. var pack = packer();
  12. p.pipe(JSONStream.stringify()).pipe(pack).pipe(concat(function (src) {
  13. Function('console', src.toString('utf8'))({
  14. log: function (msg) { t.equal(msg, 333) }
  15. });
  16. }));
  17. });