mirror of
https://github.com/dorny/test-reporter.git
synced 2025-12-17 14:57:09 +01:00
Merge remote-tracking branch 'upstream/main'
This commit is contained in:
parent
258d3a0780
commit
dd2ae7c835
38 changed files with 40986 additions and 17818 deletions
|
|
@ -29,7 +29,12 @@ import {
|
|||
} from '../../test-results'
|
||||
|
||||
class TestRun {
|
||||
constructor(readonly path: string, readonly suites: TestSuite[], readonly success: boolean, readonly time: number) {}
|
||||
constructor(
|
||||
readonly path: string,
|
||||
readonly suites: TestSuite[],
|
||||
readonly success: boolean,
|
||||
readonly time: number
|
||||
) {}
|
||||
}
|
||||
|
||||
class TestSuite {
|
||||
|
|
@ -74,7 +79,10 @@ class TestCase {
|
|||
export class DartJsonParser implements TestParser {
|
||||
assumedWorkDir: string | undefined
|
||||
|
||||
constructor(readonly options: ParseOptions, readonly sdk: 'dart' | 'flutter') {}
|
||||
constructor(
|
||||
readonly options: ParseOptions,
|
||||
readonly sdk: 'dart' | 'flutter'
|
||||
) {}
|
||||
|
||||
async parse(path: string, content: string): Promise<TestRunResult> {
|
||||
const tr = this.getTestRun(path, content)
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ export class JestJunitParser implements TestParser {
|
|||
junit.testsuites.testsuite === undefined
|
||||
? []
|
||||
: junit.testsuites.testsuite.map(ts => {
|
||||
const name = ts.$.name.trim()
|
||||
const name = this.escapeCharacters(ts.$.name.trim())
|
||||
const time = parseFloat(ts.$.time) * 1000
|
||||
const sr = new TestSuiteResult(name, this.getGroups(ts), time)
|
||||
return sr
|
||||
|
|
@ -118,4 +118,8 @@ export class JestJunitParser implements TestParser {
|
|||
(this.assumedWorkDir = getBasePath(path, this.options.trackedFiles))
|
||||
)
|
||||
}
|
||||
|
||||
private escapeCharacters(s: string): string {
|
||||
return s.replace(/([<>])/g, '\\$1')
|
||||
}
|
||||
}
|
||||
|
|
|
|||
8
src/parsers/swift-xunit/swift-xunit-parser.ts
Normal file
8
src/parsers/swift-xunit/swift-xunit-parser.ts
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
import {ParseOptions} from '../../test-parser'
|
||||
import {JavaJunitParser} from '../java-junit/java-junit-parser'
|
||||
|
||||
export class SwiftXunitParser extends JavaJunitParser {
|
||||
constructor(readonly options: ParseOptions) {
|
||||
super(options)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue