You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

20 lines
387 B

var test = require('tap').test;
var parents = require('../');
test('dirname', function (t) {
var dirs = parents('/foo/bar/baz/quux');
t.same(dirs, [
'/foo/bar/baz/quux',
'/foo/bar/baz',
'/foo/bar',
'/foo',
'/',
]);
t.end();
});
test('root', function (t) {
var dirs = parents('/');
t.same(dirs, [ '/' ]);
t.end();
});