-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathspec.js
19 lines (18 loc) · 820 Bytes
/
spec.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
const rmext = require('.');
describe('rmext', () => {
it('Should remove extname from file path', () => {
expect(rmext('/workspace/application/file.json')).to.equal('/workspace/application/file');
});
it('Should remove extname from file URL', () => {
expect(rmext('https://www.website.com/directory/page.html')).to.equal('https://www.website.com/directory/page');
});
it('Should strip only last charecters from filename', () => {
expect(rmext('file.name.with.dots.extension')).to.equal('file.name.with.dots');
});
it('Should leave files with no extensions', () => {
expect(rmext('/workspace/application/notes')).to.equal('/workspace/application/notes');
});
it('Should leave dotfiles', () => {
expect(rmext('/workspace/application/.gitignore')).to.equal('/workspace/application/.gitignore');
});
});