mirror of
https://github.com/dorny/test-reporter.git
synced 2025-12-16 06:17:10 +01:00
Fix tests + jest-junit uses action 'name' input for title
This commit is contained in:
parent
4e2ae7493f
commit
e7636701ef
3 changed files with 4 additions and 4 deletions
|
|
@ -2,7 +2,7 @@ import * as fs from 'fs'
|
||||||
import * as path from 'path'
|
import * as path from 'path'
|
||||||
|
|
||||||
import {parseDartJson} from '../src/parsers/dart-json/dart-json-parser'
|
import {parseDartJson} from '../src/parsers/dart-json/dart-json-parser'
|
||||||
import {ParseOptions} from '../src/parsers/test-parser'
|
import {ParseOptions} from '../src/parsers/parser-types'
|
||||||
|
|
||||||
const xmlFixture = fs.readFileSync(path.join(__dirname, 'fixtures', 'dart-json.json'), {encoding: 'utf8'})
|
const xmlFixture = fs.readFileSync(path.join(__dirname, 'fixtures', 'dart-json.json'), {encoding: 'utf8'})
|
||||||
const outputPath = __dirname + '/__outputs__/dart-json.md'
|
const outputPath = __dirname + '/__outputs__/dart-json.md'
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ import * as fs from 'fs'
|
||||||
import * as path from 'path'
|
import * as path from 'path'
|
||||||
|
|
||||||
import {parseJestJunit} from '../src/parsers/jest-junit/jest-junit-parser'
|
import {parseJestJunit} from '../src/parsers/jest-junit/jest-junit-parser'
|
||||||
import {ParseOptions} from '../src/parsers/test-parser'
|
import {ParseOptions} from '../src/parsers/parser-types'
|
||||||
|
|
||||||
const xmlFixture = fs.readFileSync(path.join(__dirname, 'fixtures', 'jest-junit.xml'), {encoding: 'utf8'})
|
const xmlFixture = fs.readFileSync(path.join(__dirname, 'fixtures', 'jest-junit.xml'), {encoding: 'utf8'})
|
||||||
const outputPath = __dirname + '/__outputs__/jest-junit.md'
|
const outputPath = __dirname + '/__outputs__/jest-junit.md'
|
||||||
|
|
@ -10,7 +10,7 @@ const outputPath = __dirname + '/__outputs__/jest-junit.md'
|
||||||
describe('jest-junit tests', () => {
|
describe('jest-junit tests', () => {
|
||||||
it('matches report snapshot', async () => {
|
it('matches report snapshot', async () => {
|
||||||
const opts: ParseOptions = {
|
const opts: ParseOptions = {
|
||||||
name: 'unused',
|
name: 'jest tests',
|
||||||
annotations: true,
|
annotations: true,
|
||||||
trackedFiles: ['__tests__/main.test.js', '__tests__/second.test.js', 'lib/main.js'],
|
trackedFiles: ['__tests__/main.test.js', '__tests__/second.test.js', 'lib/main.js'],
|
||||||
workDir: 'C:/Users/Michal/Workspace/dorny/test-check/reports/jest/'
|
workDir: 'C:/Users/Michal/Workspace/dorny/test-check/reports/jest/'
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ export async function parseJestJunit(content: string, options: ParseOptions): Pr
|
||||||
return {
|
return {
|
||||||
success,
|
success,
|
||||||
output: {
|
output: {
|
||||||
title: `${junit.testsuites.$.name.trim()} ${icon}`,
|
title: `${options.name.trim()} ${icon}`,
|
||||||
summary: getSummary(junit),
|
summary: getSummary(junit),
|
||||||
annotations: options.annotations ? getAnnotations(junit, options.workDir, options.trackedFiles) : undefined
|
annotations: options.annotations ? getAnnotations(junit, options.workDir, options.trackedFiles) : undefined
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue