Skip to content

Commit

Permalink
test: fix mocha rc
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Sep 8, 2021
1 parent 6f79535 commit 74a35a5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .mocharc.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ const specs = [

function getSpecFromArgv() {
if (!process.env.npm_config_argv) return specs
const { original } = JSON.parse(process.env.npm_config_argv)
if (original.length === 1) return specs
process.argv.splice(1 - original.length, Infinity)
return original.slice(1).flatMap((path) => {
const args = JSON.parse(process.env.npm_config_argv).original.filter(arg => !arg.startsWith('-'))
if (args.length === 1) return specs
process.argv.splice(1 - args.length, Infinity)
return args.slice(1).flatMap((path) => {
const [lib] = path.split('/')
const target = path.slice(lib.length)
const prefix = `packages/${libraries[lib]}/tests/`
Expand Down

0 comments on commit 74a35a5

Please sign in to comment.