diff --git a/test/test-79-npm/main.js b/test/test-79-npm/main.js index 06f87597..303ffcdb 100644 --- a/test/test-79-npm/main.js +++ b/test/test-79-npm/main.js @@ -11,7 +11,7 @@ const UPM = process.env.USE_PREINSTALLED_MODULES || false; // USE_PREINSTALLED_M const fs = require('fs'); const path = require('path'); const assert = require('assert'); -const globby = require('globby'); +const { globSync } = require('tinyglobby'); const utils = require('../utils.js'); assert(!module.parent); @@ -126,19 +126,12 @@ if (!UPM) { })(); // note to developpers: -// you can set the env variable FILTER to something like "better-sqlite3/*.js" +// you can set the env variable FILTER to something like "better-sqlite3/*.js" // to restrict this test to this single test case -const inputs = globby - .sync([ - process.env.FILTER || './*/*.js', - '!./*/*.config.js', - '!./*/*.meta.js', - '!./*/gulpfile.js', - '!./*/*fixture*', - ]) - .map(function (result) { - return path.resolve(result); - }); +const inputs = globSync([process.env.FILTER || '*/*.js'], { + absolute: true, + ignore: ['*/*.config.js', '*/*.meta.js', '*/gulpfile.js', '*/*fixture*'], +}); let times = {}; const ci = process.env.CI; @@ -308,14 +301,14 @@ inputs.some(function (input) { const deployFiles = []; if (!meta.deployFiles && !meta.deployFilesFrom) { - globby - .sync(path.join(foldy, 'node_modules', '**', '*.node')) - .some(function (deployFrom) { + globSync(path.join(foldy, 'node_modules', '**', '*.node')).some( + function (deployFrom) { deployFiles.push([ deployFrom, path.join(path.dirname(output), path.basename(deployFrom)), ]); - }); + }, + ); } const deployFilesRelative = []; @@ -361,9 +354,8 @@ inputs.some(function (input) { if (statFrom.isFile()) { deployFiles.push([deployFrom, deployTo]); } else { - globby - .sync(path.join(deployFrom, '**', '*')) - .some(function (deployFrom2) { + globSync(path.join(deployFrom, '**', '*')).some( + function (deployFrom2) { const r = path.relative(deployFrom, deployFrom2); const deployTo2 = path.join(deployTo, r); if (fs.existsSync(deployFrom2)) { @@ -372,7 +364,8 @@ inputs.some(function (input) { deployFiles.push([deployFrom2, deployTo2]); } } - }); + }, + ); } } }); @@ -410,7 +403,7 @@ inputs.some(function (input) { } } - const rubbishes = globby.sync(path.join(path.dirname(output), '**', '*')); + const rubbishes = globSync(path.join(path.dirname(output), '**', '*')); rubbishes.some(function (rubbish) { utils.vacuum.sync(rubbish);