forked from actions/typescript-action
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjunit.ts
More file actions
25 lines (24 loc) · 693 Bytes
/
junit.ts
File metadata and controls
25 lines (24 loc) · 693 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import { type ReportMatcher } from '../main';
/**
* Generic matcher for reports in JUnit format.
* @see example ./fixtures/junit.xml
*/
export const junitMatcher = {
format: 'xml',
item: '//testcase',
level: {
// Ignore testcase elements that are successful.
ignore: 'not(failure) and not(skipped) and not(error)',
notice: 'skipped',
},
// Select message based on the result type.
message: `
if(error, normalize(concat(error/@message, " \n ", error/text())),
if(skipped, skipped/@message,
normalize(concat(failure/@message, " \n ", failure/text()))
)
)`,
title: 'concat(@classname, " - ", @name)',
file: '@file',
startLine: '@line',
} satisfies ReportMatcher;