Repositorio del curso CCOM4030 el semestre B91 del proyecto Artesanías con el Instituto de Cultura

shadowed_core.js 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. var test = require('tape');
  2. var resolve = require('../');
  3. var path = require('path');
  4. test('shadowed core modules still return core module', function (t) {
  5. t.plan(2);
  6. resolve('util', { basedir: path.join(__dirname, 'shadowed_core') }, function (err, res) {
  7. t.ifError(err);
  8. t.equal(res, 'util');
  9. });
  10. });
  11. test('shadowed core modules still return core module [sync]', function (t) {
  12. t.plan(1);
  13. var res = resolve.sync('util', { basedir: path.join(__dirname, 'shadowed_core') });
  14. t.equal(res, 'util');
  15. });
  16. test('shadowed core modules return shadow when appending `/`', function (t) {
  17. t.plan(2);
  18. resolve('util/', { basedir: path.join(__dirname, 'shadowed_core') }, function (err, res) {
  19. t.ifError(err);
  20. t.equal(res, path.join(__dirname, 'shadowed_core/node_modules/util/index.js'));
  21. });
  22. });
  23. test('shadowed core modules return shadow when appending `/` [sync]', function (t) {
  24. t.plan(1);
  25. var res = resolve.sync('util/', { basedir: path.join(__dirname, 'shadowed_core') });
  26. t.equal(res, path.join(__dirname, 'shadowed_core/node_modules/util/index.js'));
  27. });