Skip to content

Commit c9219d7

Browse files
committed
format
1 parent 6a891db commit c9219d7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/junitParser.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ async function parseFile(file: string, projectTokenDictionaryStrs: string[]) {
7070
const data: string = fs.readFileSync(file, 'utf8');
7171
const parser = new XMLParser({ allowBooleanAttributes: true, ignoreAttributes: false, attributeNamePrefix: '' });
7272
const report = parser.parse(data) as Partial<JUnitReport>;
73-
const testsuites = castArray(report?.testsuite || report.testsuites?.testsuite);
74-
return Promise.all(testsuites.map(async testsuite => parseSuite(file, projectTokenDictionaryStrs, testsuite)));
73+
const testsuites = castArray(report?.testsuite || report?.testsuites?.testsuite);
74+
return Promise.all(testsuites.map(async (testsuite: JUnitSuite | undefined) => parseSuite(file, projectTokenDictionaryStrs, testsuite)));
7575
}
7676

7777
async function parseSuite(fileName: string, projectTokenDictionaryStrs: string[], testsuite?: JUnitSuite) {
@@ -128,7 +128,7 @@ export async function parseTestReports(checkName: string, summary: string, repor
128128
if (totalCount === 0) {
129129
continue;
130130
}
131-
const failed = annotations.filter(an => an.annotation_level !== 'notice').length;
131+
const failed = annotations.filter((an: { annotation_level: string; }) => an.annotation_level !== 'notice').length;
132132
const passed = totalCount - failed - skipped;
133133
testResults.push({
134134
summary,
@@ -147,7 +147,7 @@ export async function parseTestReports(checkName: string, summary: string, repor
147147
return testResults;
148148
}
149149

150-
class NoTestsFoundError extends Error { }
150+
class NoTestsFoundError extends Error {}
151151

152152
export async function getTestReports(inputs: Readonly<ReturnType<typeof parseInputs>>) {
153153
core.startGroup(`📦 Process test results`);
@@ -156,7 +156,7 @@ export async function getTestReports(inputs: Readonly<ReturnType<typeof parseInp
156156
core.info(`Retrieved ${reportsCount} report globs/files to process.`);
157157

158158
const allResults = await Promise.all(
159-
inputs.reportPaths.map(async (_, i) =>
159+
inputs.reportPaths.map(async (_: any, i: any) =>
160160
parseTestReports(
161161
retrieve('checkName', inputs.checkName, i, reportsCount),
162162
retrieve('summary', inputs.summary, i, reportsCount),

0 commit comments

Comments
 (0)