mirror of
https://github.com/dorny/test-reporter.git
synced 2025-12-15 22:07:09 +01:00
Correct behavior for test cases with slashes
This commit is contained in:
parent
34f1c566ff
commit
a0398fb7dd
7 changed files with 228 additions and 78 deletions
|
|
@ -1,17 +1,17 @@
|
|||
import * as fs from 'fs'
|
||||
import * as path from 'path'
|
||||
|
||||
import { GolangJsonParser } from '../src/parsers/golang-json/golang-json-parser'
|
||||
import { ParseOptions } from '../src/test-parser'
|
||||
import { getReport } from '../src/report/get-report'
|
||||
import { normalizeFilePath } from '../src/utils/path-utils'
|
||||
import {GolangJsonParser} from '../src/parsers/golang-json/golang-json-parser'
|
||||
import {ParseOptions} from '../src/test-parser'
|
||||
import {getReport} from '../src/report/get-report'
|
||||
import {normalizeFilePath} from '../src/utils/path-utils'
|
||||
|
||||
describe('golang-json tests', () => {
|
||||
it('report from ./reports/dotnet test results matches snapshot', async () => {
|
||||
const fixturePath = path.join(__dirname, 'fixtures', 'golang-json.json')
|
||||
const outputPath = path.join(__dirname, '__outputs__', 'golang-json.md')
|
||||
const filePath = normalizeFilePath(path.relative(__dirname, fixturePath))
|
||||
const fileContent = fs.readFileSync(fixturePath, { encoding: 'utf8' })
|
||||
const fileContent = fs.readFileSync(fixturePath, {encoding: 'utf8'})
|
||||
|
||||
const opts: ParseOptions = {
|
||||
parseErrors: true,
|
||||
|
|
@ -23,7 +23,7 @@ describe('golang-json tests', () => {
|
|||
expect(result).toMatchSnapshot()
|
||||
|
||||
const report = getReport([result])
|
||||
fs.mkdirSync(path.dirname(outputPath), { recursive: true })
|
||||
fs.mkdirSync(path.dirname(outputPath), {recursive: true})
|
||||
fs.writeFileSync(outputPath, report)
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue