coffeeify.js 543 B

12345678910111213141516171819
  1. var test = require('tap').test;
  2. var browserify = require('../');
  3. var vm = require('vm');
  4. test('coffeeify with an implicit global', function (t) {
  5. t.plan(1);
  6. var b = browserify(__dirname + '/coffeeify/main.coffee');
  7. b.transform('coffeeify');
  8. b.bundle(function (err, src) {
  9. if (err) t.fail(err);
  10. vm.runInNewContext(src, {
  11. console: { log: log },
  12. setTimeout: setTimeout,
  13. clearTimeout: clearTimeout
  14. });
  15. function log (msg) { t.equal(msg, 'eyo') }
  16. });
  17. });