From 266b7c821a3f71089d068e5a8626daefe11a0372 Mon Sep 17 00:00:00 2001 From: Benjamin Coe Date: Sun, 9 Jun 2024 18:31:54 -0700 Subject: [PATCH] test: use posix path --- index.js | 4 ++-- test/glob.js | 4 ++-- test/test-exclude.js | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/index.js b/index.js index c7c718b..89dca75 100644 --- a/index.js +++ b/index.js @@ -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) { @@ -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) { diff --git a/test/glob.js b/test/glob.js index bae38a8..dc1886a 100644 --- a/test/glob.js +++ b/test/glob.js @@ -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); } diff --git a/test/test-exclude.js b/test/test-exclude.js index eedc31f..50f8dd7 100644 --- a/test/test-exclude.js +++ b/test/test-exclude.js @@ -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: [ @@ -37,7 +37,7 @@ t.test('ignores ./', t => ] }) ); - +/*() t.test('ignores ./test and ./tests', t => testHelper(t, { no: ['./test/index.js', './tests/index.js'] @@ -143,7 +143,7 @@ t.test( t => testHelper(t, { options: { - exclude: ['!**/node_modules/**'] + exclude: ['!** /node_modules/**'] }, yes: [ './banana/node_modules/cat.js',