refactor: use Set instead of Array when appropriate (#39324)
This commit is contained in:
parent
c5e50e4882
commit
fe93f69e5a
3 changed files with 7 additions and 7 deletions
|
@ -108,12 +108,12 @@ async function main () {
|
|||
|
||||
const onlyTests = args.only && args.only.split(',');
|
||||
|
||||
const DISABLED_TESTS = [
|
||||
const DISABLED_TESTS = new Set([
|
||||
'nannew-test.js',
|
||||
'buffer-test.js'
|
||||
];
|
||||
]);
|
||||
const testsToRun = fs.readdirSync(path.resolve(NAN_DIR, 'test', 'js'))
|
||||
.filter(test => !DISABLED_TESTS.includes(test))
|
||||
.filter(test => !DISABLED_TESTS.has(test))
|
||||
.filter(test => {
|
||||
return !onlyTests || onlyTests.includes(test) || onlyTests.includes(test.replace('.js', '')) || onlyTests.includes(test.replace('-test.js', ''));
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue