From 6d2d025d3b0b6fcdbca51a4e9131a244cba3a65e Mon Sep 17 00:00:00 2001 From: Conduitry Date: Wed, 23 Oct 2019 17:04:21 -0400 Subject: [PATCH] tidy up core test.js script --- test/test.js | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/test/test.js b/test/test.js index df6585f7dad3..6ea4bd60ab6c 100644 --- a/test/test.js +++ b/test/test.js @@ -8,17 +8,14 @@ require('../internal'); console.clear(); -const testFolders = glob('*/index.js', { cwd: 'test' }); -const solo = testFolders.find(folder => /\.solo/.test(folder)); +const test_folders = glob('*/index.js', { cwd: 'test' }); +const solo_folders = test_folders.filter(folder => /\.solo/.test(folder)); -if (solo) { +if (solo_folders.length) { if (process.env.CI) { - throw new Error('Forgot to remove `solo: true` from test'); + throw new Error('Forgot to remove `.solo` from test'); } - require('./' + solo); + solo_folders.forEach(name => require('./' + name)); } else { - testFolders.forEach(file => { - console.log('file', file); - require('./' + file); - }); + test_folders.forEach(name => require('./' + name)); }