Skip to content

Commit

Permalink
test: use posix path
Browse files Browse the repository at this point in the history
  • Loading branch information
bcoe committed Jun 10, 2024
1 parent e14eed6 commit 266b7c8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class TestExclude {

globSync(cwd = this.cwd) {
const globPatterns = getExtensionPattern(this.extension || []);
const globOptions = {}; // { cwd, nodir: true, dot: true, windowsPathsNoEscape: true };
const globOptions = { posix: true }; // { cwd, nodir: true, dot: true, windowsPathsNoEscape: true };
/* If we don't have any excludeNegated then we can optimize glob by telling
* it to not iterate into unwanted directory trees (like node_modules). */
if (this.excludeNegated.length === 0) {
Expand All @@ -118,7 +118,7 @@ class TestExclude {

async glob(cwd = this.cwd) {
const globPatterns = getExtensionPattern(this.extension || []);
const globOptions = { nodir: true, dot: true, windowsPathsNoEscape: true };
const globOptions = { nodir: true, dot: true };
/* If we don't have any excludeNegated then we can optimize glob by telling
* it to not iterate into unwanted directory trees (like node_modules). */
if (this.excludeNegated.length === 0) {
Expand Down
4 changes: 2 additions & 2 deletions test/glob.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ const TestExclude = require('../');
async function testHelper(t, { options, args = [], label }) {
const e = new TestExclude(options);
const sync = e.globSync(...args).sort();
const pr = (await e.glob(...args)).sort();
// const pr = (await e.glob(...args)).sort();

deepEqual(sync, 'batman');

// deepEqual(sync, pr, 'glob and globSync should find the same files');
deepEqual(sync, pr, 'glob and globSync should find the same files');
// deepEqual(sync, pr, 'glob and globSync should find the same files');
// t.matchSnapshot(sync, label);
}

Expand Down
6 changes: 3 additions & 3 deletions test/test-exclude.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ t.test('should exclude the node_modules folder by default', t =>
no: ['./banana/node_modules/cat.js', 'node_modules/cat.js']
})
);
/*

t.test('ignores ./', t =>
testHelper(t, {
no: [
Expand All @@ -37,7 +37,7 @@ t.test('ignores ./', t =>
]
})
);
/*()
t.test('ignores ./test and ./tests', t =>
testHelper(t, {
no: ['./test/index.js', './tests/index.js']
Expand Down Expand Up @@ -143,7 +143,7 @@ t.test(
t =>
testHelper(t, {
options: {
exclude: ['!**/node_modules/**']
exclude: ['!** /node_modules/**']
},
yes: [
'./banana/node_modules/cat.js',
Expand Down

0 comments on commit 266b7c8

Please sign in to comment.