mirror of
https://github.com/dorny/test-reporter.git
synced 2025-12-17 14:57:09 +01:00
Fix reporter 'split props' bug
This commit is contained in:
parent
e9fa2f582c
commit
c5e83d0629
4 changed files with 102 additions and 1 deletions
|
|
@ -73,6 +73,28 @@ describe('java-junit tests', () => {
|
|||
fs.writeFileSync(outputPath, report)
|
||||
})
|
||||
|
||||
it('report from jest in junit format', async () => {
|
||||
const fixturePath = path.join(__dirname, 'fixtures', 'external', 'java', 'test-report-jest.xml')
|
||||
const trackedFilesPath = path.join(__dirname, 'fixtures', 'external', 'java', 'files.txt')
|
||||
const outputPath = path.join(__dirname, '__outputs__', 'pulsar-test-results.md')
|
||||
const filePath = normalizeFilePath(path.relative(__dirname, fixturePath))
|
||||
const fileContent = fs.readFileSync(fixturePath, {encoding: 'utf8'})
|
||||
|
||||
const trackedFiles = fs.readFileSync(trackedFilesPath, {encoding: 'utf8'}).split(/\n\r?/g)
|
||||
const opts: ParseOptions = {
|
||||
parseErrors: true,
|
||||
trackedFiles
|
||||
}
|
||||
|
||||
const parser = new JavaJunitParser(opts)
|
||||
const result = await parser.parse(filePath, fileContent)
|
||||
expect(result).toMatchSnapshot()
|
||||
|
||||
const report = getReport([result])
|
||||
fs.mkdirSync(path.dirname(outputPath), {recursive: true})
|
||||
fs.writeFileSync(outputPath, report)
|
||||
})
|
||||
|
||||
it('parses empty failures in test results', async () => {
|
||||
const fixturePath = path.join(__dirname, 'fixtures', 'external', 'java', 'empty_failures.xml')
|
||||
const filePath = normalizeFilePath(path.relative(__dirname, fixturePath))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue