Allow ATOM_PACKAGES_TO_TEST env var to set which packages to run tests for

This commit is contained in:
Michelle Tilley
2017-05-10 12:55:10 +02:00
parent 1b165804c3
commit 8d4376757a

View File

@@ -63,6 +63,11 @@ function runCoreRenderProcessTests (callback) {
// Build an array of functions, each running tests for a different bundled package
const packageTestSuites = []
for (let packageName in CONFIG.appMetadata.packageDependencies) {
if (process.env.ATOM_PACKAGES_TO_TEST) {
const packagesToTest = process.env.ATOM_PACKAGES_TO_TEST.split(',').map(pkg => pkg.trim())
if (!packagesToTest.includes(packageName)) continue
}
const repositoryPackagePath = path.join(CONFIG.repositoryRootPath, 'node_modules', packageName)
const testSubdir = ['spec', 'test'].find(subdir => fs.existsSync(path.join(repositoryPackagePath, subdir)))