Add tests for path utils module

This commit is contained in:
Samy Pessé
2016-02-18 12:15:53 +01:00
parent 576d773fec
commit 202c235c66
2 changed files with 17 additions and 0 deletions
+1
View File
@@ -1,6 +1,7 @@
// Utilities
require('./location');
require('./paths');
// Parsing
require('./config');
+16
View File
@@ -0,0 +1,16 @@
var pathUtils = require('../lib/utils/path');
describe('Paths', function() {
describe('setExtension', function() {
it('should correctly change extension of filename', function() {
pathUtils.setExtension('test.md', '.html').should.be.equal('test.html');
pathUtils.setExtension('test.md', '.json').should.be.equal('test.json');
});
it('should correctly change extension of path', function() {
pathUtils.setExtension('hello/test.md', '.html').should.be.equal('hello/test.html');
pathUtils.setExtension('hello/test.md', '.json').should.be.equal('hello/test.json');
});
});
});