         editor = e
 
       # Activate the package
-      waitsForPromise -> atom.packages.activatePackage('autocomplete-plus').then (a) ->
-        mainModule = a.mainModule
+      waitsForPromise ->
+        atom.packages.activatePackage("language-javascript").then ->
+          atom.packages.activatePackage("autocomplete-plus").then (a) ->
+            mainModule = a.mainModule
 
       waitsFor ->
         mainModule.autocompleteManager?.ready

{triggerAutocompletion, buildIMECompositionEvent, buildTextInputEvent} = require('./spec-helper')
_ = require('underscore-plus')
TestProvider = require('./lib/test-provider')

describe 'Autocomplete', ->
  [completionDelay, editorView, editor, mainModule, autocompleteManager] = []

        autocompleteManager = mainModule.autocompleteManager

      runs ->
        advanceClock 1
        editorView = atom.views.getView(editor)

    it "runs a completion ", ->
      provider = autocompleteManager.providerManager.fuzzyProvider
      expect(indexOfWord(provider.wordList, 'quicksort')).not.toEqual(-1)

    it "adds words to the wordlist after they have been written", ->
      provider = autocompleteManager.providerManager.fuzzyProvider

      expect(provider.wordList.indexOf('somethingNew')).toEqual(-1)
