added checks

This commit is contained in:
2016-02-04 14:21:48 +01:00
parent c5cfa79f14
commit 3511f36b67
10 changed files with 98 additions and 4 deletions

View File

@ -27,4 +27,19 @@ describe("smartfile", function () {
(vinyl.isVinyl(testData)).should.be.true();
});
});
describe(".checks".yellow, function () {
describe(".fileExistsSync".yellow, function () {
it("should return an accurate boolean", function () {
(smartfile.checks.fileExistsSync("./test/mytest.json")).should.be.true();
(smartfile.checks.fileExistsSync("./test/notthere.json")).should.be.false();
});
});
describe(".fileExists".yellow, function () {
it("should return a working promise", function () {
(smartfile.checks.fileExists("./test/mytest.json")).should.be.Promise();
(smartfile.checks.fileExists("./test/mytest.json")).should.be.fulfilled();
(smartfile.checks.fileExists("./test/notthere.json")).should.not.be.fulfilled();
});
});
});
});