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

chore: take mjs spec files in Node.js smoke tests
This commit is contained in:
Shelley Vohr 2023-01-31 21:36:27 +01:00 committed by GitHub
parent 730a07ad62
commit 26ee197fe5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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