Skip to content

Commit 18033c7

Browse files
Handle breaking change in vinyl-fs
1 parent 8e19ac9 commit 18033c7

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/src.test.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -228,21 +228,25 @@ test("Pushes expected files into stream with vPaths and complex glob", async t =
228228
clean();
229229
});
230230

231+
// NOTE `vinyl-fs` will only resolve files under `cwd`, unlike our implementation.
232+
// This test differs from others as a result.
231233
test("Outputs equivalent to vinyl-fs package", async t => {
232-
const { pathAsRelative, clean } = prep(t);
234+
const { pathAsAbsolute, clean } = prep(t);
233235

234236
const actual = await src({
235-
globs: [ pathAsRelative("test-data") + "/**/*.js" ],
237+
globs: [ "test-data/**/*.js" ],
236238
pathMappings: [],
237239
logger: logAdapter(t.log),
240+
base: pathAsAbsolute(""),
241+
cwd: pathAsAbsolute(""),
238242
}).toArray();
239243

240244
// NOTE 'as' casting required due to NodeJS.ReadWriteStream being incompatible with import('stream').Stream
241245
// In practice they are usually identical.
242246
const helperStream = new stream.PassThrough({ objectMode: true });
243247
vinylFs.src(
244-
pathAsRelative("test-data") + "/**/*.js",
245-
{ base: process.cwd() }
248+
"test-data/**/*.js",
249+
{ base: pathAsAbsolute(""), cwd: pathAsAbsolute("") }
246250
).pipe(helperStream);
247251
const expected = await helperStream.toArray();
248252

0 commit comments

Comments
 (0)