tidy up core test.js script

pull/3782/head
Conduitry 5 years ago
parent 5dbb08d19b
commit 6d2d025d3b

@ -8,17 +8,14 @@ require('../internal');
console.clear(); console.clear();
const testFolders = glob('*/index.js', { cwd: 'test' }); const test_folders = glob('*/index.js', { cwd: 'test' });
const solo = testFolders.find(folder => /\.solo/.test(folder)); const solo_folders = test_folders.filter(folder => /\.solo/.test(folder));
if (solo) { if (solo_folders.length) {
if (process.env.CI) { 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 { } else {
testFolders.forEach(file => { test_folders.forEach(name => require('./' + name));
console.log('file', file);
require('./' + file);
});
} }

Loading…
Cancel
Save