Skip to content

Commit

Permalink
Fix tests + jest-junit uses action 'name' input for title
Browse files Browse the repository at this point in the history
  • Loading branch information
Michal Dorner committed Jan 10, 2021
1 parent 4e2ae74 commit e763670
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion __tests__/dart-json.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as fs from 'fs'
import * as path from 'path'

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 outputPath = __dirname + '/__outputs__/dart-json.md'
Expand Down
4 changes: 2 additions & 2 deletions __tests__/jest-junit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ import * as fs from 'fs'
import * as path from 'path'

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 outputPath = __dirname + '/__outputs__/jest-junit.md'

describe('jest-junit tests', () => {
it('matches report snapshot', async () => {
const opts: ParseOptions = {
name: 'unused',
name: 'jest tests',
annotations: true,
trackedFiles: ['__tests__/main.test.js', '__tests__/second.test.js', 'lib/main.js'],
workDir: 'C:/Users/Michal/Workspace/dorny/test-check/reports/jest/'
Expand Down
2 changes: 1 addition & 1 deletion src/parsers/jest-junit/jest-junit-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export async function parseJestJunit(content: string, options: ParseOptions): Pr
return {
success,
output: {
title: `${junit.testsuites.$.name.trim()} ${icon}`,
title: `${options.name.trim()} ${icon}`,
summary: getSummary(junit),
annotations: options.annotations ? getAnnotations(junit, options.workDir, options.trackedFiles) : undefined
}
Expand Down

0 comments on commit e763670

Please sign in to comment.