dirname.js 387 B

1234567891011121314151617181920
  1. var test = require('tap').test;
  2. var parents = require('../');
  3. test('dirname', function (t) {
  4. var dirs = parents('/foo/bar/baz/quux');
  5. t.same(dirs, [
  6. '/foo/bar/baz/quux',
  7. '/foo/bar/baz',
  8. '/foo/bar',
  9. '/foo',
  10. '/',
  11. ]);
  12. t.end();
  13. });
  14. test('root', function (t) {
  15. var dirs = parents('/');
  16. t.same(dirs, [ '/' ]);
  17. t.end();
  18. });