Skip to content

Commit 312e342

Browse files
committed
test(test): update test/scripts/coverage-diagnostics.test.mts
1 parent 589a150 commit 312e342

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

‎test/scripts/coverage-diagnostics.test.mts‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,14 +321,21 @@ test('collects publish coverage in shards before aggregation', () => {
321321
}>
322322
}
323323
coverage: {
324+
'continue-on-error'?: boolean | undefined
325+
name: string
324326
needs: string[]
325327
steps: Array<{
328+
if?: string | undefined
326329
name?: string | undefined
327330
run?: string | undefined
328331
with?: Record<string, string> | undefined
329332
env?: Record<string, string> | undefined
330333
}>
331334
}
335+
'npm-publish': {
336+
if: string
337+
needs?: string[] | undefined
338+
}
332339
}
333340
}
334341
const collection = workflow.jobs['coverage-shards']
@@ -350,6 +357,18 @@ test('collects publish coverage in shards before aggregation', () => {
350357
})
351358

352359
const aggregate = workflow.jobs.coverage
360+
expect(aggregate['continue-on-error']).toBe(true)
361+
expect(aggregate.name).toBe('Coverage warning')
362+
expect(workflow.jobs['npm-publish'].needs).toBeUndefined()
363+
expect(workflow.jobs['npm-publish'].if).not.toContain('coverage')
364+
expect(
365+
aggregate.steps.find(
366+
step => step.name === 'Report coverage failure as a warning',
367+
),
368+
).toMatchObject({
369+
if: 'failure()',
370+
run: expect.stringContaining('::warning::'),
371+
})
353372
expect(aggregate.needs).toEqual([
354373
'coverage-plan',
355374
'coverage-build',

0 commit comments

Comments
 (0)