mirror of
https://github.com/dorny/test-reporter.git
synced 2026-02-01 02:45:22 -08:00
add lcov as reporter
This commit is contained in:
@@ -19,6 +19,7 @@ import {MochaJsonParser} from './parsers/mocha-json/mocha-json-parser'
|
||||
import {normalizeDirPath, normalizeFilePath} from './utils/path-utils'
|
||||
import {getCheckRunContext} from './utils/github-utils'
|
||||
import {Icon} from './utils/markdown-utils'
|
||||
import {LcovParser} from './parsers/lcov-json/lcov-parser'
|
||||
|
||||
async function main(): Promise<void> {
|
||||
try {
|
||||
@@ -216,6 +217,8 @@ class TestReporter {
|
||||
return new JestJunitParser(options)
|
||||
case 'mocha-json':
|
||||
return new MochaJsonParser(options)
|
||||
case 'lcov':
|
||||
return new LcovParser(options)
|
||||
default:
|
||||
throw new Error(`Input variable 'reporter' is set to invalid value '${reporter}'`)
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import {TestCaseResult, TestGroupResult, TestRunResult, TestSuiteResult} from '.
|
||||
import {CovParsedStat, CovStats, LcovReport} from './lcov-types'
|
||||
|
||||
export class LcovParser implements TestParser {
|
||||
constructor(readonly options: ParseOptions) {}
|
||||
async parse(path: string, content: string): Promise<TestRunResult> {
|
||||
const report = this.parseFile(path, content)
|
||||
return this.getTestRunResult(path, report)
|
||||
|
||||
Reference in New Issue
Block a user