mirror of
https://github.com/dorny/test-reporter.git
synced 2025-12-15 22:07:09 +01:00
Remove leading result icon + add external .net fixture
This commit is contained in:
parent
e3bb634029
commit
f55c0119bb
12 changed files with 9910 additions and 430 deletions
|
|
@ -6,15 +6,18 @@ import {ParseOptions} from '../src/parsers/parser-types'
|
|||
import {getReport} from '../src/report/get-report'
|
||||
import {normalizeFilePath} from '../src/utils/file-utils'
|
||||
|
||||
const fixturePath = path.join(__dirname, 'fixtures', 'dotnet-trx.trx')
|
||||
const outputPath = path.join(__dirname, '__outputs__', 'dotnet-trx.md')
|
||||
const xmlFixture = {
|
||||
path: normalizeFilePath(path.relative(__dirname, fixturePath)),
|
||||
content: fs.readFileSync(fixturePath, {encoding: 'utf8'})
|
||||
}
|
||||
|
||||
|
||||
describe('dotnet-trx tests', () => {
|
||||
it('matches report snapshot', async () => {
|
||||
|
||||
const fixturePath = path.join(__dirname, 'fixtures', 'dotnet-trx.trx')
|
||||
const outputPath = path.join(__dirname, '__outputs__', 'dotnet-trx.md')
|
||||
const xmlFixture = {
|
||||
path: normalizeFilePath(path.relative(__dirname, fixturePath)),
|
||||
content: fs.readFileSync(fixturePath, {encoding: 'utf8'})
|
||||
}
|
||||
|
||||
const opts: ParseOptions = {
|
||||
annotations: true,
|
||||
trackedFiles: ['DotnetTests.Unit/Calculator.cs', 'DotnetTests.XUnitTests/CalculatorTests.cs'],
|
||||
|
|
@ -28,4 +31,26 @@ describe('dotnet-trx tests', () => {
|
|||
fs.mkdirSync(path.dirname(outputPath), {recursive: true})
|
||||
fs.writeFileSync(outputPath, report)
|
||||
})
|
||||
|
||||
it('report from FluentValidation test results matches snapshot', async () => {
|
||||
const fixturePath = path.join(__dirname, 'fixtures', 'external', 'FluentValidation.Tests.trx')
|
||||
const outputPath = path.join(__dirname, '__outputs__', 'fluent-validation-test-results.md')
|
||||
const xmlFixture = {
|
||||
path: normalizeFilePath(path.relative(__dirname, fixturePath)),
|
||||
content: fs.readFileSync(fixturePath, {encoding: 'utf8'})
|
||||
}
|
||||
|
||||
const opts: ParseOptions = {
|
||||
trackedFiles: [],
|
||||
annotations: true,
|
||||
workDir: ''
|
||||
}
|
||||
|
||||
const result = await parseDotnetTrx([xmlFixture], opts)
|
||||
expect(result).toMatchSnapshot()
|
||||
|
||||
const report = getReport(result.testRuns, {listTests: 'only-failed'})
|
||||
fs.mkdirSync(path.dirname(outputPath), {recursive: true})
|
||||
fs.writeFileSync(outputPath, report)
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue