mirror of
https://github.com/dorny/test-reporter.git
synced 2026-05-06 10:37:36 +02:00
Tighten list-files report tests
This commit is contained in:
parent
45c8d46681
commit
d7f15447e6
1 changed files with 8 additions and 8 deletions
|
|
@ -172,6 +172,7 @@ describe('getReport', () => {
|
||||||
listTests: 'none'
|
listTests: 'none'
|
||||||
})
|
})
|
||||||
|
|
||||||
|
expect(report).toContain('|Report|Passed|Failed|Skipped|Time|')
|
||||||
expect(report).toContain('passing-file.spec.ts')
|
expect(report).toContain('passing-file.spec.ts')
|
||||||
expect(report).toContain('failing-file.spec.ts')
|
expect(report).toContain('failing-file.spec.ts')
|
||||||
expect(report).toContain('passing-with-skipped-file.spec.ts')
|
expect(report).toContain('passing-with-skipped-file.spec.ts')
|
||||||
|
|
@ -185,6 +186,7 @@ describe('getReport', () => {
|
||||||
listTests: 'none'
|
listTests: 'none'
|
||||||
})
|
})
|
||||||
|
|
||||||
|
expect(report).toContain('|Report|Passed|Failed|Skipped|Time|')
|
||||||
expect(report).not.toContain('passing-file.spec.ts')
|
expect(report).not.toContain('passing-file.spec.ts')
|
||||||
expect(report).toContain('failing-file.spec.ts')
|
expect(report).toContain('failing-file.spec.ts')
|
||||||
expect(report).not.toContain('passing-with-skipped-file.spec.ts')
|
expect(report).not.toContain('passing-with-skipped-file.spec.ts')
|
||||||
|
|
@ -198,26 +200,24 @@ describe('getReport', () => {
|
||||||
listTests: 'none'
|
listTests: 'none'
|
||||||
})
|
})
|
||||||
|
|
||||||
// Should still have badge
|
|
||||||
expect(report).toContain('![')
|
expect(report).toContain('![')
|
||||||
// Should not have file names in detail sections
|
expect(report).not.toContain('|Report|Passed|Failed|Skipped|Time|')
|
||||||
expect(report).not.toContain('passing-file.spec.ts')
|
expect(report).not.toContain('passing-file.spec.ts')
|
||||||
expect(report).not.toContain('failing-file.spec.ts')
|
expect(report).not.toContain('failing-file.spec.ts')
|
||||||
expect(report).not.toContain('passing-with-skipped-file.spec.ts')
|
expect(report).not.toContain('passing-with-skipped-file.spec.ts')
|
||||||
})
|
})
|
||||||
|
|
||||||
it('includes summary table even with list-files "none"', () => {
|
it('shows an empty summary table when list-files is "none" and only-summary is enabled', () => {
|
||||||
const report = getReport(results, {
|
const report = getReport(results, {
|
||||||
...DEFAULT_OPTIONS,
|
...DEFAULT_OPTIONS,
|
||||||
listFiles: 'none',
|
listFiles: 'none',
|
||||||
listSuites: 'all',
|
listSuites: 'all',
|
||||||
|
onlySummary: true,
|
||||||
listTests: 'none'
|
listTests: 'none'
|
||||||
})
|
})
|
||||||
|
|
||||||
// Badge should still be present
|
|
||||||
expect(report).toContain('![')
|
expect(report).toContain('![')
|
||||||
expect(report).toContain('badge')
|
expect(report).toContain('|Report|Passed|Failed|Skipped|Time|')
|
||||||
// File names should not be present
|
|
||||||
expect(report).not.toContain('passing-file.spec.ts')
|
expect(report).not.toContain('passing-file.spec.ts')
|
||||||
expect(report).not.toContain('failing-file.spec.ts')
|
expect(report).not.toContain('failing-file.spec.ts')
|
||||||
expect(report).not.toContain('passing-with-skipped-file.spec.ts')
|
expect(report).not.toContain('passing-with-skipped-file.spec.ts')
|
||||||
|
|
@ -231,6 +231,7 @@ describe('getReport', () => {
|
||||||
listTests: 'all'
|
listTests: 'all'
|
||||||
})
|
})
|
||||||
|
|
||||||
|
expect(report).toContain('|Report|Passed|Failed|Skipped|Time|')
|
||||||
expect(report).not.toContain('passing-file.spec.ts')
|
expect(report).not.toContain('passing-file.spec.ts')
|
||||||
expect(report).toContain('failing-file.spec.ts')
|
expect(report).toContain('failing-file.spec.ts')
|
||||||
expect(report).not.toContain('passing-with-skipped-file.spec.ts')
|
expect(report).not.toContain('passing-with-skipped-file.spec.ts')
|
||||||
|
|
@ -253,9 +254,8 @@ describe('getReport', () => {
|
||||||
|
|
||||||
expect(report).not.toContain('passing-file-1.spec.ts')
|
expect(report).not.toContain('passing-file-1.spec.ts')
|
||||||
expect(report).not.toContain('passing-file-2.spec.ts')
|
expect(report).not.toContain('passing-file-2.spec.ts')
|
||||||
// Badge should still be present
|
|
||||||
expect(report).toContain('![')
|
expect(report).toContain('![')
|
||||||
expect(report).toContain('badge')
|
expect(report).not.toContain('|Report|Passed|Failed|Skipped|Time|')
|
||||||
})
|
})
|
||||||
|
|
||||||
it('filters correctly when all files fail and list-files is "failed"', () => {
|
it('filters correctly when all files fail and list-files is "failed"', () => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue