diff --git a/build/rule-generator/questions.js b/build/rule-generator/questions.js index dc5e665d0c..28f9a511f0 100644 --- a/build/rule-generator/questions.js +++ b/build/rule-generator/questions.js @@ -33,7 +33,10 @@ const validateGetRuleName = async input => { throw new Error(`RULE name conflicts with an existing rule's filename.`); } // 3) ensure no rule id overlaps - const ruleSpecs = await glob(`${directories.rules}/**/*.json`); + const ruleSpecs = await glob(`${directories.rules}/**/*.json`, { + posix: true, + absolute: true + }); const axeRulesIds = ruleSpecs.reduce((out, specPath) => { const spec = require(specPath); out.push(spec.id); @@ -62,7 +65,10 @@ const validateGetCheckName = async input => { ); } // 2) ensure no check filename overlaps - const checkSpecs = await glob(`${directories.checks}/**/*.json`); + const checkSpecs = await glob(`${directories.checks}/**/*.json`, { + posix: true, + absolute: true + }); // cannot use `fs.existsSync` here, as we do not know which category of checks to look under const axeChecksFileNames = checkSpecs.map( f => f.replace('.json', '').split('/').reverse()[0] @@ -71,7 +77,10 @@ const validateGetCheckName = async input => { throw new Error('CHECK name conflicts with an existing filename.'); } // 3) ensure no check id overlaps - const ruleSpecs = await glob(`${directories.rules}/**/*.json`); + const ruleSpecs = await glob(`${directories.rules}/**/*.json`, { + posix: true, + absolute: true + }); const axe = require(directories.axePath); const axeChecksIds = ruleSpecs.reduce((out, specPath) => { const spec = require(specPath); diff --git a/build/tasks/metadata-function-map.js b/build/tasks/metadata-function-map.js index e2e9d6054c..36b5836703 100644 --- a/build/tasks/metadata-function-map.js +++ b/build/tasks/metadata-function-map.js @@ -22,7 +22,7 @@ module.exports = function (grunt) { '// This file is automatically generated using build/tasks/metadata-function-map.js\n'; src.forEach(globPath => { - glob.sync(globPath).forEach(filePath => { + glob.sync(globPath, { posix: true }).forEach(filePath => { const relativePath = path.relative( path.dirname(file.dest), filePath diff --git a/test/aria-practices/apg.spec.js b/test/aria-practices/apg.spec.js index f7da832530..fd1c630ee7 100644 --- a/test/aria-practices/apg.spec.js +++ b/test/aria-practices/apg.spec.js @@ -9,7 +9,8 @@ describe('aria-practices', function () { // Use path.resolve rather than require.resolve because APG package.json main file does not exist const apgPath = path.resolve(__dirname, '../../node_modules/aria-practices/'); const filePaths = globSync( - `${apgPath}/content/patterns/*/**/examples/*.html` + `${apgPath}/content/patterns/*/**/examples/*.html`, + { posix: true } ); const testFiles = filePaths.map( fileName => fileName.split('/aria-practices/content/patterns/')[1]