mirror of
https://github.com/dorny/test-reporter.git
synced 2025-12-15 22:07:09 +01:00
Add integration test for empty TRX TestDefinitions
This commit is contained in:
parent
2acf6c2ccd
commit
5b44774702
2 changed files with 38 additions and 0 deletions
|
|
@ -23,6 +23,22 @@ describe('dotnet-trx tests', () => {
|
|||
expect(result.result).toBe('success')
|
||||
})
|
||||
|
||||
it('produces empty test run result when TestDefinitions is empty', async () => {
|
||||
const fixturePath = path.join(__dirname, 'fixtures', 'empty', 'dotnet-trx-empty-test-definitions.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