Skip to content

Commit

Permalink
Merge pull request #38 from lpelypenko/do-not-show-info-message-for-d…
Browse files Browse the repository at this point in the history
…oNotCreateReportFile-true

do not show an info message if user provided doNotCreateReportFile = true
  • Loading branch information
lpelypenko authored Aug 22, 2024
2 parents 516b193 + 62e7d13 commit 3cf6b3a
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 3cf6b3a

Please sign in to comment.