-
Notifications
You must be signed in to change notification settings - Fork 696
Expand file tree
/
Copy pathignore.js
More file actions
33 lines (27 loc) · 870 Bytes
/
ignore.js
File metadata and controls
33 lines (27 loc) · 870 Bytes
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
var assert = require("assert");
var path = require("path");
var local = path.join.bind(path, __dirname);
describe("Ignore", function() {
var NodeGit = require("../../");
var Repository = NodeGit.Repository;
var Ignore = NodeGit.Ignore;
var reposPath = local("../repos/workdir");
before(function() {
var test = this;
return Repository.open(reposPath).then(function(repository) {
test.repository = repository;
});
});
it("can determine if a path is ignored", function() {
function expectIgnoreState(repo, fileName, expected) {
return Ignore.pathIsIgnored(repo, fileName)
.then(function(ignored) {
assert.equal(ignored, expected);
});
}
return Promise.all([
expectIgnoreState(this.repository, ".git", true),
expectIgnoreState(this.repository, "LICENSE", false)
]);
});
});