preserve-symlinks.js 842 B

123456789101112131415161718192021222324252627
  1. var browserify = require('../');
  2. var vm = require('vm');
  3. var test = require('tap').test;
  4. test('optionally preserves symlinks', { skip: process.platform === 'win32' }, function (t) {
  5. t.plan(2);
  6. var b = browserify(__dirname + '/preserve_symlinks/a/index.js', {preserveSymlinks: true});
  7. b.bundle(function (err, buf) {
  8. t.ifError(err);
  9. t.ok(buf);
  10. var src = buf.toString('utf8');
  11. vm.runInNewContext(src, {});
  12. });
  13. });
  14. test('always resolve entry point symlink', { skip: process.platform === 'win32' }, function (t) {
  15. t.plan(2);
  16. var b = browserify(__dirname + '/preserve_symlinks/linked-entry.js', {preserveSymlinks: true});
  17. b.bundle(function (err, buf) {
  18. t.ifError(err);
  19. t.ok(buf);
  20. var src = buf.toString('utf8');
  21. vm.runInNewContext(src, {});
  22. });
  23. })