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

1234567891011121314151617181920212223242526272829
  1. var path = require('path');
  2. var test = require('tape');
  3. var resolve = require('../');
  4. test('dotdot', function (t) {
  5. t.plan(4);
  6. var dir = path.join(__dirname, '/dotdot/abc');
  7. resolve('..', { basedir: dir }, function (err, res, pkg) {
  8. t.ifError(err);
  9. t.equal(res, path.join(__dirname, 'dotdot/index.js'));
  10. });
  11. resolve('.', { basedir: dir }, function (err, res, pkg) {
  12. t.ifError(err);
  13. t.equal(res, path.join(dir, 'index.js'));
  14. });
  15. });
  16. test('dotdot sync', function (t) {
  17. t.plan(2);
  18. var dir = path.join(__dirname, '/dotdot/abc');
  19. var a = resolve.sync('..', { basedir: dir });
  20. t.equal(a, path.join(__dirname, 'dotdot/index.js'));
  21. var b = resolve.sync('.', { basedir: dir });
  22. t.equal(b, path.join(dir, 'index.js'));
  23. });