diff --git a/bin/qunit.js b/bin/qunit.js index 500594fcb..e44f8b19f 100755 --- a/bin/qunit.js +++ b/bin/qunit.js @@ -10,7 +10,7 @@ const pkg = require('../package.json'); const description = `Runs tests using the QUnit framework. Files should be a space-separated list of files, directories, or glob expressions. - Defaults to 'test/**/*.js'. + Defaults to 'test/**/*.{js,mjs,cjs}'. For more info on working with QUnit, check out https://qunitjs.com.`; diff --git a/src/cli/utils.js b/src/cli/utils.js index 621228dd5..31465ed84 100644 --- a/src/cli/utils.js +++ b/src/cli/utils.js @@ -29,8 +29,7 @@ function getFilesFromArgs (args) { // Default to files in the test directory if (!patterns.length) { - // TODO: In QUnit 3.0, change the default to {js,mjs} - patterns.push('test/**/*.js'); + patterns.push('test/**/*.{js,mjs,cjs}'); } const files = new Set(); @@ -47,8 +46,7 @@ function getFilesFromArgs (args) { files.add(pattern); } else { if (stat && stat.isDirectory()) { - // TODO: In QUnit 3.0, change the default to {js,mjs} - pattern = `${pattern}/**/*.js`; + pattern = `${pattern}/**/*.{js,mjs,cjs}`; } const results = glob(pattern, { cwd: process.cwd(),