Skip to content

Commit

Permalink
do not show an info message if user provided doNotCreateReportFile = …
Browse files Browse the repository at this point in the history
…true
  • Loading branch information
lpelypenko committed Aug 22, 2024
1 parent 516b193 commit 62e7d13
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 1 addition & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@ export function createHtmlReport({ results, options }: CreateReport): string {
hasAxeRawResults: Boolean(results?.timestamp),
rules: prepareAxeRules(results?.toolOptions?.rules || {}),
});
if (options?.doNotCreateReportFile === true) {
console.info('Report file will not be created because user passed options.doNotCreateReportFile = true. Use HTML output of the function to create report file');
} else {
if (!options || options.doNotCreateReportFile === undefined || !options.doNotCreateReportFile) {
saveHtmlReport({
htmlContent,
reportFileName: options?.reportFileName,
Expand Down
5 changes: 4 additions & 1 deletion test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,10 @@ describe('Successful tests', () => {
<li>Open https://dequeuniversity.com/demo/mars/</li>
<li>Analyze full page with all rules enabled</li>
</ol>`;

const reportFileName = 'shouldNotBeSaved.html';
fs.rmSync(getPathToCreatedReport(reportFileName), {
force: true,
});
const reportHTML = createHtmlReport({
results: rawAxeResults,
options: {
Expand Down

0 comments on commit 62e7d13

Please sign in to comment.