Welcome to mirror list, hosted at ThFree Co, Russian Federation.

basic.js « test « fstream-ignore « node_modules - github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 3718076eedf5b3437a5a78ec55020d1614b52976 (plain)
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
var IgnoreFile = require("../")

// set the ignores just for this test
var c = require("./common.js")
c.ignores({ "a/.basic-ignore": ["b/", "aca"] })

// the files that we expect to not see
var notAllowed =
  [ /^\/a\/b\/.*/
  , /^\/a\/.*\/aca$/ ]


require("tap").test("basic ignore rules", function (t) {
  t.pass("start")

  IgnoreFile({ path: __dirname + "/fixtures"
             , ignoreFiles: [".basic-ignore"] })
    .on("ignoreFile", function (e) {
      console.error("ignore file!", e)
    })
    .on("child", function (e) {
      var p = e.path.substr(e.root.path.length)
      notAllowed.forEach(function (na) {
        t.dissimilar(p, na)
      })
    })
    .on("close", t.end.bind(t))
})