 
   afterEach ->
     waitsForPromise ->
-      Promise.resolve(atom.packages.deactivatePackage("snippets"))
+      atom.packages.deactivatePackage('snippets')
 
   describe "provideSnippets interface", ->
     snippetsInterface = null

      atom.packages.activatePackage('language-javascript')

    waitsForPromise ->
      atom.packages.activatePackage("snippets")

    runs ->
      editor = atom.workspace.getActiveTextEditor()


    describe "bundledSnippetsLoaded", ->
      it "indicates the loaded state of the bundled snippets", ->
        expect(snippetsInterface.bundledSnippetsLoaded()).toBe false
        Snippets.doneLoading()
        expect(snippetsInterface.bundledSnippetsLoaded()).toBe true

      it "resets the loaded state after snippets is deactivated", ->
        expect(snippetsInterface.bundledSnippetsLoaded()).toBe false
        Snippets.doneLoading()
        expect(snippetsInterface.bundledSnippetsLoaded()).toBe true

        waitsForPromise -> atom.packages.deactivatePackage('snippets')
        waitsForPromise -> atom.packages.activatePackage('snippets')

        runs ->
          expect(snippetsInterface.bundledSnippetsLoaded()).toBe false
          Snippets.doneLoading()
          expect(snippetsInterface.bundledSnippetsLoaded()).toBe true

    describe "insertSnippet", ->
      it "can insert a snippet", ->
        editor.setSelectedBufferRange([[0, 4], [0, 13]])
        snippetsInterface.insertSnippet("hello ${1:world}", editor)
