Sha256: bfb48dfbf448d82e082632959af1683bc753d90b8f7ab0120401de9658574f3c

Contents?: true

Size: 759 Bytes

Versions: 92

Compression:

Stored size: 759 Bytes

Contents

var glob = require('../')
var test = require('tap').test
var path = require('path')

test('stat all the things', function(t) {
  var g = new glob.Glob('a/*abc*/**', { stat: true, cwd: __dirname })
  var matches = []
  g.on('match', function(m) {
    matches.push(m)
  })
  var stats = []
  g.on('stat', function(m) {
    stats.push(m)
  })
  g.on('end', function(eof) {
    stats = stats.sort()
    matches = matches.sort()
    eof = eof.sort()
    t.same(stats, matches)
    t.same(eof, matches)
    var cache = Object.keys(this.statCache)
    t.same(cache.map(function (f) {
      return path.relative(__dirname, f)
    }).sort(), matches)

    cache.forEach(function(c) {
      t.equal(typeof this.statCache[c], 'object')
    }, this)

    t.end()
  })
})

Version data entries

92 entries across 70 versions & 8 rubygems

Version Path
stylus-source-0.38.0 vendor/node_modules/mocha/node_modules/glob/test/stat.js
stylus-source-0.37.0 vendor/node_modules/mocha/node_modules/glob/test/stat.js
stylus-source-0.36.1 vendor/node_modules/mocha/node_modules/glob/test/stat.js
stylus-source-0.36.0 vendor/node_modules/mocha/node_modules/glob/test/stat.js
stylus-source-0.35.1 vendor/node_modules/mocha/node_modules/glob/test/stat.js
stylus-source-0.35.0 vendor/node_modules/mocha/node_modules/glob/test/stat.js
stylus-source-0.34.1 vendor/node_modules/mocha/node_modules/glob/test/stat.js
stylus-source-0.34.0 vendor/node_modules/mocha/node_modules/glob/test/stat.js
stylus-source-0.33.1 vendor/node_modules/mocha/node_modules/glob/test/stat.js
stylus-source-0.33.0 vendor/node_modules/mocha/node_modules/glob/test/stat.js
stylus-source-0.32.1 vendor/node_modules/mocha/node_modules/glob/test/stat.js
stylus-source-0.32.0 vendor/node_modules/mocha/node_modules/glob/test/stat.js