Created
March 5, 2018 19:06
-
-
Save sveneisenschmidt/9588bdac4e21d7e2c3ed63f8824bf258 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function runSuite(suite, suiteConf, browser) { | |
// Start: New Code | |
// check chunks, if chunks are set, expand suite | |
if(suiteConf.chunks && Number.isFinite(suiteConf.chunks)) { | |
let pattern = config.tests || null; | |
if (pattern) { | |
let forks = []; | |
let files = findFiles(pattern); | |
let chunkSize = Math.ceil(files.length/suiteConf.chunks); | |
let chunks = createChunks(files, chunkSize); | |
let chunkConfig = { ...suiteConf }; | |
delete chunkConfig.chunks; | |
chunks.map((chunk, index) => { | |
const tests = createGlob(chunk); | |
const name = `${suite}-${index}`; | |
const fork = runSuite(name , { ...chunkConfig, tests }, browser); | |
if (Array.isArray(fork)) { | |
forks.push(...fork); | |
} else { | |
forks.push(fork); | |
} | |
}); | |
if (forks.length > 0) { | |
return forks; | |
} | |
} | |
} | |
// End: New Code | |
// ... | |
if (!browser) { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment