mirror of
https://github.com/atom/atom.git
synced 2026-01-23 22:08:08 -05:00
Merge branch 'tests' of https://github.com/Xapphire13/atom into Xapphire13-tests
This commit is contained in:
18
script/test
18
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) {
|
||||
|
||||
@@ -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 () => {
|
||||
|
||||
Reference in New Issue
Block a user