Browse Source

chore: validate `.mjs` spec files in Node.js smoke tests (#37073)

chore: take mjs spec files in Node.js smoke tests
Shelley Vohr 2 years ago
parent
commit
26ee197fe5
1 changed files with 3 additions and 2 deletions
  1. 3 2
      script/node-spec-runner.js

+ 3 - 2
script/node-spec-runner.js

@@ -57,8 +57,9 @@ async function main () {
   if (args.validateDisabled) {
     const missing = [];
     for (const test of DISABLED_TESTS) {
-      const testName = test.endsWith('.js') ? test : `${test}.js`;
-      if (!fs.existsSync(path.join(NODE_DIR, 'test', testName))) {
+      const js = path.join(NODE_DIR, 'test', `${test}.js`);
+      const mjs = path.join(NODE_DIR, 'test', `${test}.mjs`);
+      if (!fs.existsSync(js) && !fs.existsSync(mjs)) {
         missing.push(test);
       }
     }