File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -21,16 +21,16 @@ const getConfiguration = ({
2121 runners = runners || DEFAULT_RUNNERS ;
2222
2323 if ( isInvalidRunner ( runners ) ) {
24- throw new Error ( `Invalid value for \`runners\` input. Runners must be ${ AXE } or ${ HTMLCS } ` ) ;
24+ throw new Error ( `Invalid value for \`runners\` input. Runners must be \` ${ AXE } \` or \` ${ HTMLCS } \`. ` ) ;
2525 }
2626 return {
2727 absolutePublishDir : PUBLISH_DIR || process . env . PUBLISH_DIR ,
2828 checkPaths : checkPaths || DEFAULT_CHECK_PATHS ,
2929 debugMode : debugMode || false ,
3030 ignoreDirectories : ignoreDirectories || DEFAULT_IGNORE_DIRECTORIES ,
31+ resultMode : resultMode || DEFAULT_RESULT_MODE ,
3132 pa11yOpts : {
3233 runners,
33- resultMode : resultMode || DEFAULT_RESULT_MODE ,
3434 userAgent : PA11Y_USER_AGENT ,
3535 }
3636 }
Original file line number Diff line number Diff line change @@ -14,7 +14,8 @@ module.exports = {
1414 checkPaths,
1515 debugMode,
1616 ignoreDirectories,
17- pa11yOpts
17+ pa11yOpts,
18+ resultMode,
1819 } = getConfiguration ( { constants, inputs } )
1920 const htmlFilePaths = await pluginCore . generateFilePaths ( {
2021 absolutePublishDir,
@@ -32,8 +33,13 @@ module.exports = {
3233 pa11yOpts,
3334 } ) ;
3435 if ( issueCount > 0 ) {
36+ const postRunMsg = `Pa11y found ${ issueCount } accessibility issues with your site! Check the logs above for more information.`
3537 console . log ( results ) ;
36- build . failBuild ( `Pa11y found ${ issueCount } accessibility issues with your site! Check the logs above for more information` ) ;
38+ if ( resultMode === 'error' ) {
39+ build . failBuild ( postRunMsg )
40+ } else {
41+ console . warn ( postRunMsg )
42+ }
3743 }
3844
3945 } catch ( err ) {
You can’t perform that action at this time.
0 commit comments