mirror of
https://github.com/dorny/test-reporter.git
synced 2025-12-15 22:07:09 +01:00
Handle test reports with no test cases
This commit is contained in:
parent
a1cbedbccb
commit
a9749e3840
13 changed files with 114 additions and 18 deletions
|
|
@ -7,6 +7,22 @@ import {getReport} from '../src/report/get-report'
|
|||
import {normalizeFilePath} from '../src/utils/path-utils'
|
||||
|
||||
describe('dotnet-trx tests', () => {
|
||||
it('produces empty test run result when there are no test cases', async () => {
|
||||
const fixturePath = path.join(__dirname, 'fixtures', 'empty', 'dotnet-trx.trx')
|
||||
const filePath = normalizeFilePath(path.relative(__dirname, fixturePath))
|
||||
const fileContent = fs.readFileSync(fixturePath, {encoding: 'utf8'})
|
||||
|
||||
const opts: ParseOptions = {
|
||||
parseErrors: true,
|
||||
trackedFiles: []
|
||||
}
|
||||
|
||||
const parser = new DotnetTrxParser(opts)
|
||||
const result = await parser.parse(filePath, fileContent)
|
||||
expect(result.tests).toBe(0)
|
||||
expect(result.result).toBe('success')
|
||||
})
|
||||
|
||||
it('matches report snapshot', async () => {
|
||||
const fixturePath = path.join(__dirname, 'fixtures', 'dotnet-trx.trx')
|
||||
const outputPath = path.join(__dirname, '__outputs__', 'dotnet-trx.md')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue