mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Wrap temp.cleanupSync() calls in try-catch blocks
This commit is contained in:
@@ -6,7 +6,8 @@ StorageFolder = require '../src/storage-folder'
|
||||
|
||||
describe "AtomEnvironment", ->
|
||||
afterEach ->
|
||||
temp.cleanupSync()
|
||||
try
|
||||
temp.cleanupSync()
|
||||
|
||||
describe 'window sizing methods', ->
|
||||
describe '::getPosition and ::setPosition', ->
|
||||
|
||||
@@ -86,7 +86,11 @@ describe("AtomPaths", () => {
|
||||
afterEach(() => {
|
||||
delete process.env.ATOM_HOME
|
||||
fs.removeSync(electronUserDataPath)
|
||||
temp.cleanupSync()
|
||||
try {
|
||||
temp.cleanupSync()
|
||||
} catch (e) {
|
||||
// Ignore
|
||||
}
|
||||
app.setPath('userData', defaultElectronUserDataPath)
|
||||
})
|
||||
|
||||
|
||||
@@ -19,7 +19,8 @@ describe "Babel transpiler support", ->
|
||||
|
||||
afterEach ->
|
||||
CompileCache.setCacheDirectory(originalCacheDir)
|
||||
temp.cleanupSync()
|
||||
try
|
||||
temp.cleanupSync()
|
||||
|
||||
describe 'when a .js file starts with /** @babel */;', ->
|
||||
it "transpiles it using babel", ->
|
||||
|
||||
@@ -21,7 +21,8 @@ describe "CommandInstaller on #darwin", ->
|
||||
spyOn(CommandInstaller::, 'getInstallDirectory').andReturn(installationPath)
|
||||
|
||||
afterEach ->
|
||||
temp.cleanupSync()
|
||||
try
|
||||
temp.cleanupSync()
|
||||
|
||||
it "shows an error dialog when installing commands interactively fails", ->
|
||||
appDelegate = jasmine.createSpyObj("appDelegate", ["confirm"])
|
||||
|
||||
@@ -23,7 +23,8 @@ describe 'CompileCache', ->
|
||||
afterEach ->
|
||||
CompileCache.setAtomHomeDirectory(process.env.ATOM_HOME)
|
||||
CSON.setCacheDir(CompileCache.getCacheDirectory())
|
||||
temp.cleanupSync()
|
||||
try
|
||||
temp.cleanupSync()
|
||||
|
||||
describe 'addPathToCache(filePath, atomHome)', ->
|
||||
describe 'when the given file is plain javascript', ->
|
||||
|
||||
@@ -10,7 +10,8 @@ describe "DefaultDirectoryProvider", ->
|
||||
tmp = temp.mkdirSync('atom-spec-default-dir-provider')
|
||||
|
||||
afterEach ->
|
||||
temp.cleanupSync()
|
||||
try
|
||||
temp.cleanupSync()
|
||||
|
||||
describe ".directoryForURISync(uri)", ->
|
||||
it "returns a Directory with a path that matches the uri", ->
|
||||
|
||||
@@ -12,7 +12,8 @@ describe "GitRepositoryProvider", ->
|
||||
provider = new GitRepositoryProvider(atom.project, atom.config, atom.confirm)
|
||||
|
||||
afterEach ->
|
||||
temp.cleanupSync()
|
||||
try
|
||||
temp.cleanupSync()
|
||||
|
||||
describe ".repositoryForDirectory(directory)", ->
|
||||
describe "when specified a Directory with a Git repository", ->
|
||||
|
||||
@@ -24,7 +24,8 @@ describe "the `grammars` global", ->
|
||||
afterEach ->
|
||||
atom.packages.deactivatePackages()
|
||||
atom.packages.unloadPackages()
|
||||
temp.cleanupSync()
|
||||
try
|
||||
temp.cleanupSync()
|
||||
|
||||
describe ".selectGrammar(filePath)", ->
|
||||
it "always returns a grammar", ->
|
||||
|
||||
@@ -16,7 +16,11 @@ describe("FileRecoveryService", () => {
|
||||
})
|
||||
|
||||
afterEach(() => {
|
||||
temp.cleanupSync()
|
||||
try {
|
||||
temp.cleanupSync()
|
||||
} catch (e) {
|
||||
// Ignore
|
||||
}
|
||||
})
|
||||
|
||||
describe("when no crash happens during a save", () => {
|
||||
|
||||
@@ -9,7 +9,8 @@ describe 'ModuleCache', ->
|
||||
spyOn(Module, '_findPath').andCallThrough()
|
||||
|
||||
afterEach ->
|
||||
temp.cleanupSync()
|
||||
try
|
||||
temp.cleanupSync()
|
||||
|
||||
it 'resolves Electron module paths without hitting the filesystem', ->
|
||||
builtins = ModuleCache.cache.builtins
|
||||
|
||||
@@ -17,7 +17,8 @@ describe "PackageManager", ->
|
||||
spyOn(ModuleCache, 'add')
|
||||
|
||||
afterEach ->
|
||||
temp.cleanupSync()
|
||||
try
|
||||
temp.cleanupSync()
|
||||
|
||||
describe "::getApmPath()", ->
|
||||
it "returns the path to the apm command", ->
|
||||
|
||||
@@ -37,7 +37,8 @@ describe "Windows Squirrel Update", ->
|
||||
WinShell.folderBackgroundContextMenu = new FakeShellOption()
|
||||
|
||||
afterEach ->
|
||||
temp.cleanupSync()
|
||||
try
|
||||
temp.cleanupSync()
|
||||
|
||||
it "quits the app on all squirrel events", ->
|
||||
app = quit: jasmine.createSpy('quit')
|
||||
|
||||
@@ -15,7 +15,11 @@ describe('StyleManager', () => {
|
||||
})
|
||||
|
||||
afterEach(() => {
|
||||
temp.cleanupSync()
|
||||
try {
|
||||
temp.cleanupSync()
|
||||
} catch (e) {
|
||||
// Do nothing
|
||||
}
|
||||
})
|
||||
|
||||
describe('::addStyleSheet(source, params)', () => {
|
||||
|
||||
@@ -9,7 +9,8 @@ describe "atom.themes", ->
|
||||
|
||||
afterEach ->
|
||||
atom.themes.deactivateThemes()
|
||||
temp.cleanupSync()
|
||||
try
|
||||
temp.cleanupSync()
|
||||
|
||||
describe "theme getters and setters", ->
|
||||
beforeEach ->
|
||||
|
||||
@@ -28,7 +28,11 @@ describe('updateProcessEnv(launchEnv)', function () {
|
||||
}
|
||||
process.env = originalProcessEnv
|
||||
process.platform = originalProcessPlatform
|
||||
temp.cleanupSync()
|
||||
try {
|
||||
temp.cleanupSync()
|
||||
} catch (e) {
|
||||
// Do nothing
|
||||
}
|
||||
})
|
||||
|
||||
describe('when the launch environment appears to come from a shell', function () {
|
||||
|
||||
@@ -9,7 +9,13 @@ const {Disposable} = require('event-kit')
|
||||
const {it, fit, ffit, fffit, beforeEach, afterEach} = require('./async-spec-helpers')
|
||||
|
||||
describe('WorkspaceElement', () => {
|
||||
afterEach(() => { temp.cleanupSync() })
|
||||
afterEach(() => {
|
||||
try {
|
||||
temp.cleanupSync()
|
||||
} catch (e) {
|
||||
// Do nothing
|
||||
}
|
||||
})
|
||||
|
||||
describe('when the workspace element is focused', () => {
|
||||
it('transfers focus to the active pane', () => {
|
||||
|
||||
@@ -25,7 +25,13 @@ describe('Workspace', () => {
|
||||
waitsForPromise(() => atom.workspace.itemLocationStore.clear())
|
||||
})
|
||||
|
||||
afterEach(() => temp.cleanupSync())
|
||||
afterEach(() => {
|
||||
try {
|
||||
temp.cleanupSync()
|
||||
} catch (e) {
|
||||
// Do nothing
|
||||
}
|
||||
})
|
||||
|
||||
function simulateReload() {
|
||||
waitsForPromise(() => {
|
||||
|
||||
Reference in New Issue
Block a user