mirror of
https://github.com/dorny/test-reporter.git
synced 2025-12-16 14:27:10 +01:00
add lcov as reporter
This commit is contained in:
parent
0fc59a15c8
commit
62968bd2b2
2 changed files with 4 additions and 0 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue