Skip to content

Commit

Permalink
tidy up core test.js script
Browse files Browse the repository at this point in the history
  • Loading branch information
Conduitry committed Oct 23, 2019
1 parent 5dbb08d commit 6d2d025
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

0 comments on commit 6d2d025

Please sign in to comment.