1 | var IgnoreFile = require("../")
|
2 |
|
3 |
|
4 | var c = require("./common.js")
|
5 | c.ignores({ "a/.basic-ignore": ["b/", "aca"] })
|
6 |
|
7 |
|
8 | var notAllowed =
|
9 | [ /^\/a\/b\/.*/
|
10 | , /^\/a\/.*\/aca$/ ]
|
11 |
|
12 |
|
13 | require("tap").test("basic ignore rules", function (t) {
|
14 | t.pass("start")
|
15 |
|
16 | IgnoreFile({ path: __dirname + "/fixtures"
|
17 | , ignoreFiles: [".basic-ignore"] })
|
18 | .on("ignoreFile", function (e) {
|
19 | console.error("ignore file!", e)
|
20 | })
|
21 | .on("child", function (e) {
|
22 | var p = e.path.substr(e.root.path.length)
|
23 | notAllowed.forEach(function (na) {
|
24 | t.dissimilar(p, na)
|
25 | })
|
26 | })
|
27 | .on("close", t.end.bind(t))
|
28 | })
|