Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
Signed-off-by: Matteo Collina <hello@matteocollina.com>
  • Loading branch information
mcollina committed Dec 14, 2023
1 parent 29191a2 commit a8fcd5b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ export default async function runWithTypeScript (config) {
}

let files = config.files || []
const ignore = join('node_modules', '**')
if (files.length > 0) {
if (prefix) {
files = files.map((file) => join(prefix, file.replace(/ts$/, 'js')))
Expand All @@ -123,11 +124,11 @@ export default async function runWithTypeScript (config) {
if (prefix) {
config.pattern = join(prefix, config.pattern)
}
files = await glob(config.pattern, { ignore: 'node_modules/**', cwd })
files = await glob(config.pattern, { ignore, cwd })
} else if (prefix) {
files = await glob(join(prefix, 'test/**/*.test.{cjs,mjs,js}'), { ignore: 'node_modules/**', cwd })
files = await glob(join(prefix, join('test', '**', '*.test.{cjs,mjs,js}')), { ignore, cwd })
} else {
files = await glob('test/**/*.test.{cjs,mjs,js}', { ignore: 'node_modules/**', cwd })
files = await glob(join('test', '**', '*.test.{cjs,mjs,js}'), { ignore, cwd })
}

config.files = files
Expand Down

0 comments on commit a8fcd5b

Please sign in to comment.