Skip to content

Commit

Permalink
Fix usage of fast-glob API
Browse files Browse the repository at this point in the history
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: bahmutov/cypress-split#78 (comment)
  • Loading branch information
samtsai committed Jul 11, 2023
1 parent 57069a6 commit 935781c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 935781c

Please sign in to comment.