UNPKG

703 BJavaScriptView Raw
1var IgnoreFile = require("../")
2
3// set the ignores just for this test
4var c = require("./common.js")
5c.ignores({ "a/.basic-ignore": ["b/", "aca"] })
6
7// the files that we expect to not see
8var notAllowed =
9 [ /^\/a\/b\/.*/
10 , /^\/a\/.*\/aca$/ ]
11
12
13require("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})