fix: test-pattern

This commit is contained in:
Zoltan Kochan
2020-12-23 15:21:36 +02:00
parent 9d6d720b97
commit ea09da716b
4 changed files with 12 additions and 2 deletions

View File

@@ -0,0 +1,5 @@
---
"pnpm": patch
---
`test-pattern` should work with all commands, not just `pnpm test`.

View File

@@ -0,0 +1,5 @@
---
"@pnpm/config": patch
---
The test-pattern option should be an Array.

View File

@@ -91,7 +91,7 @@ export const types = Object.assign({
'workspace-concurrency': Number,
'workspace-packages': [String, Array],
'workspace-root': Boolean,
'test-pattern': String,
'test-pattern': [String, Array],
}, npmTypes.types)
export type CliOptions = Record<string, unknown> & { dir?: string }

View File

@@ -178,7 +178,7 @@ export default async function run (inputArgv: string[]) {
linkWorkspacePackages: !!config.linkWorkspacePackages,
prefix: process.cwd(),
workspaceDir: wsDir,
testPattern: cmd === 'test' ? config.testPattern : undefined,
testPattern: config.testPattern,
})
config.selectedProjectsGraph = filterResults.selectedProjectsGraph
if (R.isEmpty(config.selectedProjectsGraph)) {