Merge branch 'tests' of https://github.com/Xapphire13/atom into Xapphire13-tests

This commit is contained in:
Michelle Tilley
2017-11-15 00:14:44 -08:00
2 changed files with 22 additions and 4 deletions

View File

@@ -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) {

View File

@@ -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 () => {