Skip to content

Commit

Permalink
add more warning msg
Browse files Browse the repository at this point in the history
  • Loading branch information
tianfeng92 committed Feb 12, 2024
1 parent dd37837 commit 801d4fa
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/playwright-runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,21 @@ function generateJUnitFile(
) {
if (!fs.existsSync(sourceFile)) {
console.warn(
`JUnit file generation skipped as the original JUnit file (${sourceFile}) from Playwright was not located.`,
`JUnit file generation skipped: the original JUnit file (${sourceFile}) from Playwright was not located.`,
);
return;
}

const xmlData = fs.readFileSync(sourceFile, 'utf8');
if (!xmlData) {
console.warn(
`JUnit file generation skipped: failed to read the Playwright original JUnit file(${sourceFile}).`,
);
return;
}
let result: any = convert.xml2js(xmlData, { compact: true });

Check warning on line 48 in src/playwright-runner.ts

View workflow job for this annotation

GitHub Actions / test

Unexpected any. Specify a different type
if (!result.testsuites || !result.testsuites.testsuite) {
console.warn('JUnit file generation skipped: no test suites detected.');
return;
}

Expand Down

0 comments on commit 801d4fa

Please sign in to comment.