diff --git a/script/test b/script/test index 2f22b1e0a..c6c3a6a61 100755 --- a/script/test +++ b/script/test @@ -3,6 +3,7 @@ 'use strict' require('colors') +const argv = require('yargs').argv const assert = require('assert') const async = require('async') const childProcess = require('child_process') @@ -150,17 +151,26 @@ function runBenchmarkTests (callback) { let testSuitesToRun = testSuitesForPlatform(process.platform) function testSuitesForPlatform (platform) { + let suites = []; switch (platform) { case 'darwin': - return [runCoreMainProcessTests, runCoreRenderProcessTests, runBenchmarkTests].concat(packageTestSuites) + suites = [runCoreMainProcessTests, runCoreRenderProcessTests, runBenchmarkTests].concat(packageTestSuites) + break case 'win32': - return (process.arch === 'x64') ? [runCoreMainProcessTests, runCoreRenderProcessTests] : [runCoreMainProcessTests] + suites = (process.arch === 'x64') ? [runCoreMainProcessTests, runCoreRenderProcessTests] : [runCoreMainProcessTests] + break case 'linux': - return [runCoreMainProcessTests] + suites = [runCoreMainProcessTests] + break default: console.log(`Unrecognized platform: ${platform}`) - return [] } + + if (argv.skipMainProcessTests) { + suites = suites.filter(suite => suite !== runCoreMainProcessTests); + } + + return suites; } async.series(testSuitesToRun, function (err, exitCodes) { diff --git a/spec/git-repository-provider-spec.js b/spec/git-repository-provider-spec.js index e1d0168a9..24993fe9b 100644 --- a/spec/git-repository-provider-spec.js +++ b/spec/git-repository-provider-spec.js @@ -13,6 +13,14 @@ describe('GitRepositoryProvider', () => { provider = new GitRepositoryProvider(atom.project, atom.config, atom.confirm) }) + afterEach(() => { + if (provider) { + Object.keys(provider.pathToRepository).forEach(key => { + provider.pathToRepository[key].destroy() + }) + } + }) + describe('.repositoryForDirectory(directory)', () => { describe('when specified a Directory with a Git repository', () => { it('resolves with a GitRepository', async () => {