Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add failing test for "absolute ignore doesn't work" (#189) #190

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion test/ignore.js
Expand Up @@ -3,13 +3,15 @@ require('./global-leakage.js')
// Show that glob ignores results matching pattern on ignore option

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

// [pattern, ignore, expect, cwd]
var cases = [
[ '*', null, ['abcdef', 'abcfed', 'b', 'bc', 'c', 'cb', 'symlink'], 'a'],
[ '*', 'b', ['abcdef', 'abcfed', 'bc', 'c', 'cb', 'symlink'], 'a'],
[ '*', 'b*', ['abcdef', 'abcfed', 'c', 'cb', 'symlink'], 'a'],
[ '**', ['/abcdef', '/abcdef/**'], ['abcfed', 'abcfed/g', 'abcfed/g/h', 'b', 'b/c', 'b/c/d', 'bc', 'bc/e', 'bc/e/f', 'c', 'c/d', 'c/d/c', 'c/d/c/b', 'cb', 'cb/e', 'cb/e/f', 'symlink', 'symlink/a', 'symlink/a/b', 'symlink/a/b/c'], 'a'],
[ 'b/**', 'b/c/d', ['b', 'b/c'], 'a'],
[ 'b/**', 'd', ['b', 'b/c', 'b/c/d'], 'a'],
[ 'b/**', 'b/c/**', ['b'], 'a'],
Expand Down Expand Up @@ -45,8 +47,10 @@ cases.forEach(function (c, i) {
name += ' cwd=' + cwd

var opt = { ignore: ignore }
if (cwd)
if (cwd) {
opt.cwd = cwd
opt.root = path.resolve(cwd)
}

test(name, function (t) {
glob(pattern, opt, function (er, res) {
Expand Down