fix: add report summary skipped status when script is missing (#6139)
This commit is contained in:
parent
e570adc101
commit
7d64d757bb
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
"@pnpm/plugin-commands-script-runners": patch
|
||||
"@pnpm/cli-utils": patch
|
||||
"pnpm": patch
|
||||
---
|
||||
|
||||
Add `skipped` status in exec report summary when script is missing [#6139](https://github.com/pnpm/pnpm/pull/6139).
|
|
@ -9,7 +9,7 @@ interface ActionFailure {
|
|||
}
|
||||
|
||||
export type RecursiveSummary = Record<string, {
|
||||
status: 'passed' | 'queued' | 'running'
|
||||
status: 'passed' | 'queued' | 'running' | 'skipped'
|
||||
duration?: number
|
||||
} | ActionFailure>
|
||||
|
||||
|
|
|
@ -84,7 +84,9 @@ export async function runRecursive (
|
|||
const selectedScripts = chunk.map(prefix => {
|
||||
const pkg = opts.selectedProjectsGraph[prefix]
|
||||
const specifiedScripts = getSpecifiedScripts(pkg.package.manifest.scripts ?? {}, scriptName)
|
||||
|
||||
if (!specifiedScripts.length) {
|
||||
result[prefix].status = 'skipped'
|
||||
}
|
||||
return specifiedScripts.map(script => ({ prefix, scriptName: script }))
|
||||
}).flat()
|
||||
|
||||
|
|
|
@ -1008,6 +1008,10 @@ test('pnpm recursive run report summary', async () => {
|
|||
build: 'exit 1',
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'project-5',
|
||||
version: '1.0.0',
|
||||
},
|
||||
])
|
||||
let error
|
||||
try {
|
||||
|
@ -1033,6 +1037,7 @@ test('pnpm recursive run report summary', async () => {
|
|||
expect(executionStatus[path.resolve('project-3')].duration).not.toBeFalsy()
|
||||
expect(executionStatus[path.resolve('project-4')].status).toBe('failure')
|
||||
expect(executionStatus[path.resolve('project-4')].duration).not.toBeFalsy()
|
||||
expect(executionStatus[path.resolve('project-5')].status).toBe('skipped')
|
||||
})
|
||||
|
||||
test('pnpm recursive run report summary with --bail', async () => {
|
||||
|
@ -1065,6 +1070,10 @@ test('pnpm recursive run report summary with --bail', async () => {
|
|||
build: 'exit 1',
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'project-5',
|
||||
version: '1.0.0',
|
||||
},
|
||||
])
|
||||
let error
|
||||
try {
|
||||
|
@ -1090,4 +1099,5 @@ test('pnpm recursive run report summary with --bail', async () => {
|
|||
expect(executionStatus[path.resolve('project-2')].duration).not.toBeFalsy()
|
||||
expect(executionStatus[path.resolve('project-3')].status).toBe('running')
|
||||
expect(executionStatus[path.resolve('project-4')].status).toBe('queued')
|
||||
expect(executionStatus[path.resolve('project-5')].status).toBe('skipped')
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue