test: move crashReporter specs to the main process (#20417)
This commit is contained in:
parent
eb100cdf9e
commit
8dad0c7aaa
8 changed files with 476 additions and 447 deletions
|
@ -91,7 +91,7 @@ app.whenReady().then(() => {
|
|||
|
||||
walker.on('end', () => {
|
||||
testFiles.sort()
|
||||
testFiles.forEach((file) => mocha.addFile(file))
|
||||
sortToEnd(testFiles, f => f.includes('crash-reporter')).forEach((file) => mocha.addFile(file))
|
||||
const cb = () => {
|
||||
// Ensure the callback is called after runner is defined
|
||||
process.nextTick(() => {
|
||||
|
@ -101,3 +101,15 @@ app.whenReady().then(() => {
|
|||
const runner = mocha.run(cb)
|
||||
})
|
||||
})
|
||||
|
||||
function partition (xs, f) {
|
||||
const trues = []
|
||||
const falses = []
|
||||
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)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue