mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Extend AtomPackage directly in packages index.coffee
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
RootView = require 'root-view'
|
||||
{$$} = require 'space-pen'
|
||||
Package = require 'package'
|
||||
|
||||
describe "the `atom` global", ->
|
||||
describe ".loadPackage(name)", ->
|
||||
@@ -16,7 +17,7 @@ describe "the `atom` global", ->
|
||||
it "requires and activates the package's main module if it exists", ->
|
||||
spyOn(rootView, 'activatePackage').andCallThrough()
|
||||
atom.loadPackage("package-with-module")
|
||||
expect(rootView.activatePackage).toHaveBeenCalledWith('package-with-module', extension)
|
||||
expect(rootView.activatePackage).toHaveBeenCalled()
|
||||
|
||||
it "logs warning instead of throwing an exception if a package fails to load", ->
|
||||
spyOn(console, "warn")
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
AtomPackage = require 'atom-package'
|
||||
|
||||
module.exports =
|
||||
class MyPackage extends AtomPackage
|
||||
activate: ->
|
||||
@activateCalled = true
|
||||
|
||||
Reference in New Issue
Block a user