-
Notifications
You must be signed in to change notification settings - Fork 306
Expand file tree
/
Copy pathutils.js
More file actions
24 lines (21 loc) · 834 Bytes
/
utils.js
File metadata and controls
24 lines (21 loc) · 834 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
var assert = require('chai').assert;
var utils = require('../lib/utils');
describe('Utility functions', function() {
describe('pathBasename', function() {
it('should return bar as relative path for /foo/bar', function() {
assert.equal(utils.pathBasename('/foo/bar'), 'bar');
});
it('should return empty as relative path for /foo/', function() {
assert.equal(utils.pathBasename('/foo/'), '');
});
it('should return empty as relative path for /', function() {
assert.equal(utils.pathBasename('/'), '');
});
it('should return empty as relative path for empty path', function() {
assert.equal(utils.pathBasename(''), '');
});
it('should return empty as relative path for undefined path', function() {
assert.equal(utils.pathBasename(undefined), '');
});
});
});