Skip to content

Commit

Permalink
Add unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jrpomeroy committed Jul 23, 2018
1 parent d70ba0a commit 85346dc
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions test/path-parsing.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,27 @@ describe('gulp-rename path parsing', function () {
helper(srcPattern, obj, null, done, { multiExt: true });
});
});

describe('original file context', function () {
it('passed to plugin as second argument', function (done) {
var srcPattern = 'test/fixtures/hello.min.txt';
var obj = function (path, file) {
file.should.be.instanceof(Object);
file.should.be.ok();
};
helper(srcPattern, obj, null, done, { multiExt: true });
});

it('has expected properties', function (done) {
var srcPattern = 'test/fixtures/hello.min.txt';
var obj = function (path, file) {
file.path.should.equal(Path.resolve(srcPattern));
file.base.should.equal(Path.dirname(Path.resolve(srcPattern)));
file.basename.should.equal(Path.basename(srcPattern));
file.relative.should.equal(Path.basename(srcPattern));
file.extname.should.equal(Path.extname(srcPattern));
};
helper(srcPattern, obj, null, done, { multiExt: true });
});
});
});

0 comments on commit 85346dc

Please sign in to comment.