mirror of
https://github.com/dorny/test-reporter.git
synced 2025-12-17 14:57:09 +01:00
chore: build dist files
This commit is contained in:
parent
98f7746baa
commit
859f41b552
2 changed files with 7 additions and 5 deletions
|
|
@ -1,15 +1,15 @@
|
||||||
import * as fs from 'fs'
|
import * as fs from 'fs'
|
||||||
import * as path from 'path'
|
import * as path from 'path'
|
||||||
|
|
||||||
import { JestJunitParser } from '../src/parsers/jest-junit/jest-junit-parser'
|
import {JestJunitParser} from '../src/parsers/jest-junit/jest-junit-parser'
|
||||||
import { ParseOptions } from '../src/test-parser'
|
import {ParseOptions} from '../src/test-parser'
|
||||||
import { normalizeFilePath } from '../src/utils/path-utils'
|
import {normalizeFilePath} from '../src/utils/path-utils'
|
||||||
|
|
||||||
describe('pytest-junit tests', () => {
|
describe('pytest-junit tests', () => {
|
||||||
it('test with one successful test', async () => {
|
it('test with one successful test', async () => {
|
||||||
const fixturePath = path.join(__dirname, 'fixtures', 'external', 'pytest', 'pytest-single-case.xml')
|
const fixturePath = path.join(__dirname, 'fixtures', 'external', 'pytest', 'pytest-single-case.xml')
|
||||||
const filePath = normalizeFilePath(path.relative(__dirname, fixturePath))
|
const filePath = normalizeFilePath(path.relative(__dirname, fixturePath))
|
||||||
const fileContent = fs.readFileSync(fixturePath, { encoding: 'utf8' })
|
const fileContent = fs.readFileSync(fixturePath, {encoding: 'utf8'})
|
||||||
|
|
||||||
const opts: ParseOptions = {
|
const opts: ParseOptions = {
|
||||||
parseErrors: true,
|
parseErrors: true,
|
||||||
|
|
|
||||||
4
dist/index.js
generated
vendored
4
dist/index.js
generated
vendored
|
|
@ -1211,7 +1211,9 @@ class JestJunitParser {
|
||||||
const sr = new test_results_1.TestSuiteResult(name, this.getGroups(ts), time);
|
const sr = new test_results_1.TestSuiteResult(name, this.getGroups(ts), time);
|
||||||
return sr;
|
return sr;
|
||||||
});
|
});
|
||||||
const time = parseFloat(junit.testsuites.$.time) * 1000;
|
const time = junit.testsuites.$ === undefined
|
||||||
|
? suites.reduce((sum, suite) => sum + suite.time, 0)
|
||||||
|
: parseFloat(junit.testsuites.$.time) * 1000;
|
||||||
return new test_results_1.TestRunResult(path, suites, time);
|
return new test_results_1.TestRunResult(path, suites, time);
|
||||||
}
|
}
|
||||||
getGroups(suite) {
|
getGroups(suite) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue