From 935781c40de47f469503f28fbad51279bc41c62f Mon Sep 17 00:00:00 2001 From: Sam Tsai Date: Tue, 11 Jul 2023 09:37:59 -0400 Subject: [PATCH] Fix usage of fast-glob API globby depends on fast-glob which introduced a breaking change in 3.3.0. Their API has been expecting an string[] for `ignore` option for awhile but in the latest version it causes a TypeError. Make sure the `ignore` option is passed an array. Fixes issues for: https://github.com/bahmutov/cypress-split/issues/78#issuecomment-1630108191 --- src/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 23f6225..d7097cc 100644 --- a/src/index.js +++ b/src/index.js @@ -149,7 +149,9 @@ function findCypressSpecsV10(opts = {}, type = 'e2e') { /** @type string[] */ const files = globby.sync(options.specPattern, { sort: true, - ignore: options.excludeSpecPattern, + ignore: Array.isArray(options.excludeSpecPattern) + ? options.excludeSpecPattern + : [options.excludeSpecPattern], }) debug('found %d file(s) %o', files.length, files)