mirror of
https://github.com/atom/atom.git
synced 2026-01-23 22:08:08 -05:00
Merge branch 'master' into io-state-connected-flag
This commit is contained in:
@@ -71,6 +71,7 @@
|
||||
| [PathWatcher](https://github.com/atom/node-pathwatcher) | [](https://travis-ci.org/atom/node-pathwatcher) | [](https://ci.appveyor.com/project/Atom/node-pathwatcher) | [](https://david-dm.org/atom/node-pathwatcher) |
|
||||
| [Property Accessors](https://github.com/atom/property-accessors) | [](https://travis-ci.org/atom/property-accessors) | [](https://ci.appveyor.com/project/Atom/property-accessors/branch/master) | [](https://david-dm.org/atom/property-accessors) |
|
||||
| [Season](https://github.com/atom/season) | [](https://travis-ci.org/atom/season) | [](https://ci.appveyor.com/project/Atom/season) | [](https://david-dm.org/atom/season) |
|
||||
| [Superstring](https://github.com/atom/superstring) | [](https://travis-ci.org/atom/superstring) | [](https://ci.appveyor.com/project/Atom/superstring/branch/master) | | [](https://david-dm.org/atom/superstring) |
|
||||
| [TextBuffer](https://github.com/atom/text-buffer) | [](https://travis-ci.org/atom/text-buffer) | [](https://ci.appveyor.com/project/Atom/text-buffer/branch/master) | [](https://david-dm.org/atom/text-buffer) |
|
||||
| [Underscore-Plus](https://github.com/atom/underscore-plus) | [](https://travis-ci.org/atom/underscore-plus) | [](https://ci.appveyor.com/project/Atom/underscore-plus/branch/master) | [](https://david-dm.org/atom/underscore-plus) |
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
"electronVersion": "1.3.13",
|
||||
"dependencies": {
|
||||
"async": "0.2.6",
|
||||
"atom-keymap": "7.1.18",
|
||||
"atom-keymap": "7.1.19",
|
||||
"atom-select-list": "0.0.6",
|
||||
"atom-ui": "0.4.1",
|
||||
"babel-core": "5.8.38",
|
||||
@@ -65,7 +65,7 @@
|
||||
"sinon": "1.17.4",
|
||||
"source-map-support": "^0.3.2",
|
||||
"temp": "0.8.1",
|
||||
"text-buffer": "10.2.4",
|
||||
"text-buffer": "10.2.5",
|
||||
"typescript-simple": "1.0.0",
|
||||
"underscore-plus": "^1.6.6",
|
||||
"winreg": "^1.2.1",
|
||||
@@ -100,7 +100,7 @@
|
||||
"deprecation-cop": "0.55.1",
|
||||
"dev-live-reload": "0.47.0",
|
||||
"encoding-selector": "0.22.0",
|
||||
"exception-reporting": "0.40.1",
|
||||
"exception-reporting": "0.40.2",
|
||||
"find-and-replace": "0.206.0",
|
||||
"fuzzy-finder": "1.4.1",
|
||||
"git-diff": "1.2.0",
|
||||
|
||||
@@ -27,12 +27,12 @@ describe "PackageManager", ->
|
||||
apmPath += ".cmd"
|
||||
expect(atom.packages.getApmPath()).toBe apmPath
|
||||
|
||||
describe "when the core.apmPath setting is set", ->
|
||||
beforeEach ->
|
||||
atom.config.set("core.apmPath", "/path/to/apm")
|
||||
describe "when the core.apmPath setting is set", ->
|
||||
beforeEach ->
|
||||
atom.config.set("core.apmPath", "/path/to/apm")
|
||||
|
||||
it "returns the value of the core.apmPath config setting", ->
|
||||
expect(atom.packages.getApmPath()).toBe "/path/to/apm"
|
||||
it "returns the value of the core.apmPath config setting", ->
|
||||
expect(atom.packages.getApmPath()).toBe "/path/to/apm"
|
||||
|
||||
describe "::loadPackages()", ->
|
||||
beforeEach ->
|
||||
@@ -57,11 +57,13 @@ describe "PackageManager", ->
|
||||
expect(pack.metadata.name).toBe "package-with-index"
|
||||
|
||||
it "returns the package if it has an invalid keymap", ->
|
||||
spyOn(atom, 'inSpecMode').andReturn(false)
|
||||
pack = atom.packages.loadPackage("package-with-broken-keymap")
|
||||
expect(pack instanceof Package).toBe true
|
||||
expect(pack.metadata.name).toBe "package-with-broken-keymap"
|
||||
|
||||
it "returns the package if it has an invalid stylesheet", ->
|
||||
spyOn(atom, 'inSpecMode').andReturn(false)
|
||||
pack = atom.packages.loadPackage("package-with-invalid-styles")
|
||||
expect(pack instanceof Package).toBe true
|
||||
expect(pack.metadata.name).toBe "package-with-invalid-styles"
|
||||
@@ -75,6 +77,7 @@ describe "PackageManager", ->
|
||||
expect(addErrorHandler.argsForCall[1][0].options.packageName).toEqual "package-with-invalid-styles"
|
||||
|
||||
it "returns null if the package has an invalid package.json", ->
|
||||
spyOn(atom, 'inSpecMode').andReturn(false)
|
||||
addErrorHandler = jasmine.createSpy()
|
||||
atom.notifications.onDidAddNotification(addErrorHandler)
|
||||
expect(atom.packages.loadPackage("package-with-broken-package-json")).toBeNull()
|
||||
@@ -107,6 +110,7 @@ describe "PackageManager", ->
|
||||
|
||||
describe "when the package is deprecated", ->
|
||||
it "returns null", ->
|
||||
spyOn(console, 'warn')
|
||||
expect(atom.packages.loadPackage(path.join(__dirname, 'fixtures', 'packages', 'wordcount'))).toBeNull()
|
||||
expect(atom.packages.isDeprecatedPackage('wordcount', '2.1.9')).toBe true
|
||||
expect(atom.packages.isDeprecatedPackage('wordcount', '2.2.0')).toBe true
|
||||
@@ -392,6 +396,7 @@ describe "PackageManager", ->
|
||||
expect(mainModule.activate.callCount).toBe 1
|
||||
|
||||
it "adds a notification when the activation commands are invalid", ->
|
||||
spyOn(atom, 'inSpecMode').andReturn(false)
|
||||
addErrorHandler = jasmine.createSpy()
|
||||
atom.notifications.onDidAddNotification(addErrorHandler)
|
||||
expect(-> atom.packages.activatePackage('package-with-invalid-activation-commands')).not.toThrow()
|
||||
@@ -400,6 +405,7 @@ describe "PackageManager", ->
|
||||
expect(addErrorHandler.argsForCall[0][0].options.packageName).toEqual "package-with-invalid-activation-commands"
|
||||
|
||||
it "adds a notification when the context menu is invalid", ->
|
||||
spyOn(atom, 'inSpecMode').andReturn(false)
|
||||
addErrorHandler = jasmine.createSpy()
|
||||
atom.notifications.onDidAddNotification(addErrorHandler)
|
||||
expect(-> atom.packages.activatePackage('package-with-invalid-context-menu')).not.toThrow()
|
||||
@@ -546,8 +552,9 @@ describe "PackageManager", ->
|
||||
waitsFor -> activatedPackage?
|
||||
runs -> expect(activatedPackage.name).toBe 'package-with-main'
|
||||
|
||||
describe "when the package throws an error while loading", ->
|
||||
describe "when the package's main module throws an error on load", ->
|
||||
it "adds a notification instead of throwing an exception", ->
|
||||
spyOn(atom, 'inSpecMode').andReturn(false)
|
||||
atom.config.set("core.disabledPackages", [])
|
||||
addErrorHandler = jasmine.createSpy()
|
||||
atom.notifications.onDidAddNotification(addErrorHandler)
|
||||
@@ -556,6 +563,11 @@ describe "PackageManager", ->
|
||||
expect(addErrorHandler.argsForCall[0][0].message).toContain("Failed to load the package-that-throws-an-exception package")
|
||||
expect(addErrorHandler.argsForCall[0][0].options.packageName).toEqual "package-that-throws-an-exception"
|
||||
|
||||
it "re-throws the exception in test mode", ->
|
||||
atom.config.set("core.disabledPackages", [])
|
||||
addErrorHandler = jasmine.createSpy()
|
||||
expect(-> atom.packages.activatePackage("package-that-throws-an-exception")).toThrow("This package throws an exception")
|
||||
|
||||
describe "when the package is not found", ->
|
||||
it "rejects the promise", ->
|
||||
atom.config.set("core.disabledPackages", [])
|
||||
@@ -893,6 +905,7 @@ describe "PackageManager", ->
|
||||
|
||||
describe "::serialize", ->
|
||||
it "does not serialize packages that threw an error during activation", ->
|
||||
spyOn(atom, 'inSpecMode').andReturn(false)
|
||||
spyOn(console, 'warn')
|
||||
badPack = null
|
||||
waitsForPromise ->
|
||||
@@ -940,6 +953,7 @@ describe "PackageManager", ->
|
||||
atom.packages.unloadPackages()
|
||||
|
||||
it "calls `deactivate` on the package's main module if activate was successful", ->
|
||||
spyOn(atom, 'inSpecMode').andReturn(false)
|
||||
pack = null
|
||||
waitsForPromise ->
|
||||
atom.packages.activatePackage("package-with-deactivate").then (p) -> pack = p
|
||||
@@ -1028,6 +1042,7 @@ describe "PackageManager", ->
|
||||
|
||||
describe "::activate()", ->
|
||||
beforeEach ->
|
||||
spyOn(atom, 'inSpecMode').andReturn(false)
|
||||
jasmine.snapshotDeprecations()
|
||||
spyOn(console, 'warn')
|
||||
atom.packages.loadPackages()
|
||||
@@ -1042,6 +1057,7 @@ describe "PackageManager", ->
|
||||
jasmine.restoreDeprecationsSnapshot()
|
||||
|
||||
it "sets hasActivatedInitialPackages", ->
|
||||
spyOn(atom.styles, 'getUserStyleSheetPath').andReturn(null)
|
||||
spyOn(atom.packages, 'activatePackages')
|
||||
expect(atom.packages.hasActivatedInitialPackages()).toBe false
|
||||
waitsForPromise -> atom.packages.activate()
|
||||
|
||||
@@ -4,6 +4,7 @@ temp = require('temp').track()
|
||||
|
||||
describe "atom.themes", ->
|
||||
beforeEach ->
|
||||
spyOn(atom, 'inSpecMode').andReturn(false)
|
||||
spyOn(console, 'warn')
|
||||
|
||||
afterEach ->
|
||||
|
||||
@@ -15,6 +15,7 @@ exports.on = function (emitter, eventName, callback) {
|
||||
exports.call = function (channel, ...args) {
|
||||
if (!ipcRenderer) {
|
||||
ipcRenderer = require('electron').ipcRenderer
|
||||
ipcRenderer.setMaxListeners(20)
|
||||
}
|
||||
|
||||
var responseChannel = getResponseChannel(channel)
|
||||
|
||||
@@ -711,6 +711,9 @@ class Package
|
||||
incompatibleNativeModules
|
||||
|
||||
handleError: (message, error) ->
|
||||
if atom.inSpecMode()
|
||||
throw error
|
||||
|
||||
if error.filename and error.location and (error instanceof SyntaxError)
|
||||
location = "#{error.filename}:#{error.location.first_line + 1}:#{error.location.first_column + 1}"
|
||||
detail = "#{error.message} in #{location}"
|
||||
|
||||
Reference in New Issue
Block a user