dollar.js 475 B

1234567891011121314151617
  1. var browserify = require('../');
  2. var vm = require('vm');
  3. var test = require('tap').test;
  4. test('dollar', function (t) {
  5. t.plan(2);
  6. var b = browserify();
  7. b.require(__dirname + '/dollar/dollar/index.js', { expose: 'dollar' });
  8. b.bundle(function (err, src) {
  9. t.ok(src.length > 0);
  10. var c = {};
  11. vm.runInNewContext(src, c);
  12. var res = vm.runInNewContext('require("dollar")(100)', c);
  13. t.equal(res, 10000);
  14. });
  15. });