require_cache.js 428 B

12345678910111213141516171819
  1. var vm = require('vm');
  2. var browserify = require('../');
  3. var test = require('tap').test;
  4. test('cached require results', function (t) {
  5. t.plan(1);
  6. var b = browserify();
  7. b.require('seq');
  8. b.bundle(function (err, src) {
  9. var c = {};
  10. vm.runInNewContext(src, c);
  11. var seq0 = c.require('seq');
  12. var seq1 = c.require('seq');
  13. t.ok(seq0 === seq1);
  14. });
  15. });