forked from firebase/firebase-tools
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfsutils.spec.ts
33 lines (26 loc) · 1014 Bytes
/
fsutils.spec.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import { expect } from "chai";
import * as fsutils from "./fsutils";
describe("fsutils", () => {
describe("fileExistsSync", () => {
it("should return true if the file exists", () => {
expect(fsutils.fileExistsSync(__filename)).to.be.true;
});
it("should return false if the file does not exist", () => {
expect(fsutils.fileExistsSync(`${__filename}/nope.never`)).to.be.false;
});
it("should return false if the path is a directory", () => {
expect(fsutils.fileExistsSync(__dirname)).to.be.false;
});
});
describe("dirExistsSync", () => {
it("should return true if the directory exists", () => {
expect(fsutils.dirExistsSync(__dirname)).to.be.true;
});
it("should return false if the directory does not exist", () => {
expect(fsutils.dirExistsSync(`${__dirname}/nope/never`)).to.be.false;
});
it("should return false if the path is a file", () => {
expect(fsutils.dirExistsSync(__filename)).to.be.false;
});
});
});