test: refactor crashReporter tests (#23178)

This commit is contained in:
Jeremy Apthorp 2020-04-22 15:53:12 -07:00 committed by GitHub
parent 375b793984
commit 6fa05dd123
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 451 additions and 548 deletions

View file

@ -90,7 +90,7 @@ app.whenReady().then(() => {
walker.on('end', () => {
testFiles.sort();
sortToEnd(testFiles, f => f.includes('crash-reporter')).forEach((file) => {
testFiles.forEach((file) => {
if (!argv.files || argv.files.includes(path.relative(baseElectronDir, file))) {
mocha.addFile(file);
}
@ -117,8 +117,3 @@ function partition (xs, f) {
xs.forEach(x => (f(x) ? trues : falses).push(x));
return [trues, falses];
}
function sortToEnd (xs, f) {
const [end, beginning] = partition(xs, f);
return beginning.concat(end);
}