From ebe6498124294306a7491958aebf0d3a184bdf11 Mon Sep 17 00:00:00 2001 From: Blaine Bublitz Date: Sun, 11 Jun 2023 22:48:12 +0100 Subject: [PATCH] fix: Add regression test for negative relative globs (#343) --- test/src.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/src.js b/test/src.js index 9ea2f7cb..1527825c 100644 --- a/test/src.js +++ b/test/src.js @@ -628,6 +628,24 @@ describeStreams('.src()', function (stream) { ); }); + it('supports glob negation with ../ paths (issue 306)', function (done) { + var cwd = path.relative(process.cwd(), __dirname); + + function assert(files) { + expect(files.length).toEqual(4); + } + + pipeline( + [ + vfs.src(['../test/fixtures/*.txt', '!../test/fixtures/bom-*.txt'], { + cwd: cwd, + }), + concatArray(assert), + ], + done + ); + }); + // TODO: need to normalize the path of a directory vinyl object it('globs a directory with default settings', function (done) { var inputDirGlob = path.join(inputBase, './f*/');