tr_no_entry.js 576 B

1234567891011121314151617181920
  1. var browserify = require('../');
  2. var test = require('tap').test;
  3. var path = require('path')
  4. test('transform with no entry files', function (t) {
  5. process.chdir(__dirname);
  6. t.plan(2);
  7. var b = browserify();
  8. b.transform('tr');
  9. b.require(path.join(__dirname, 'tr_no_entry/main.js'), {
  10. expose: 'yoyo'
  11. });
  12. b.bundle(function (err, body) {
  13. t.ifError(err);
  14. var src = body.toString('utf8') + 'require("yoyo")';
  15. var con = { log: function (msg) { t.equal(msg, 'ZZZ') } };
  16. Function('console', src)(con);
  17. });
  18. });