Skip to content

Commit

Permalink
chore: Fix unix tests
Browse files Browse the repository at this point in the history
The ignore tests are fixed similar to here: micromatch/picomatch@766bcb0
The nonull tests are changed as picomatch now does not change the slashes as of version 2.1.0
  • Loading branch information
danez committed Apr 9, 2021
1 parent fe4858b commit 211c6ad
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions test/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ describe('options', () => {
let opts = { ignore: ['a/**'], strictSlashes: true };
let dotOpts = { ...opts, dot: true };

assert.deepEqual(mm(globs, '*', opts), ['b']);
assert.deepEqual(mm(globs, '*', opts), ['a', 'b']);
assert.deepEqual(mm(globs, '*', { ...opts, strictSlashes: false }), ['b']);
assert.deepEqual(mm(globs, '*', { ignore: '**/a' }), ['b']);
assert.deepEqual(mm(globs, '*/*', opts), ['x/y', 'z/z']);
assert.deepEqual(mm(globs, '*/*/*', opts), ['b/b/b', 'b/b/c', 'c/c/c', 'e/f/g', 'h/i/a', 'x/x/x', 'z/z/z']);
Expand All @@ -39,7 +40,7 @@ describe('options', () => {
assert.deepEqual(mm(globs, '**/*/[b-z]', opts), ['b/b/b', 'b/b/c', 'c/c/c', 'e/f/g', 'x/x/x', 'x/y', 'z/z', 'z/z/z']);

assert.deepEqual(mm(globs, '*', { ignore: '**/a', dot: true }), ['.a', 'b']);
assert.deepEqual(mm(globs, '*', dotOpts), ['.a', 'b']);
assert.deepEqual(mm(globs, '*', dotOpts), ['.a', 'a', 'b']);
assert.deepEqual(mm(globs, '*/*', dotOpts), ['.a/a', 'x/y', 'z/z']);
assert.deepEqual(mm(globs, '*/*/*', dotOpts), ['.a/a/a', 'b/b/b', 'b/b/c', 'c/c/c', 'e/f/g', 'h/i/a', 'x/x/x', 'z/z/z']);
assert.deepEqual(mm(globs, '*/*/*/*', dotOpts), ['.a/a/a/a']);
Expand Down Expand Up @@ -185,9 +186,9 @@ describe('options', () => {

describe('options.nonull', () => {
it('should support the `nonull` option:', () => {
assert.deepEqual(mm(['*', '\\*'], '\\*', { nonull: true }), ['*', '/*']);
assert.deepEqual(mm(['*', '\\^'], '\\^', { nonull: true }), ['/^']);
assert.deepEqual(mm(['*', 'a\\*'], 'a\\*', { nonull: true }), ['a/*']);
assert.deepEqual(mm(['*', '\\*'], '\\*', { nonull: true }), ['*', '\\*']);
assert.deepEqual(mm(['*', '\\^'], '\\^', { nonull: true }), ['\\^']);
assert.deepEqual(mm(['*', 'a\\*'], 'a\\*', { nonull: true }), ['a\\*']);
});
});

Expand Down

0 comments on commit 211c6ad

Please sign in to comment.