         atom.packages.activatePackage('package-with-serialization')
 
       runs ->
-        atom.packages.deactivatePackages()
+        atom.packages.serialize()
         expect(atom.packages.packageStates['package-with-serialize-error']).toBeUndefined()
         expect(atom.packages.packageStates['package-with-serialization']).toEqual someNumber: 1
         expect(console.error).toHaveBeenCalled()

          expect(atom.packages.isPackageActive("package-with-missing-provided-services")).toBe true
          expect(addErrorHandler.callCount).toBe 0

  describe "::serialize", ->
    # TODO

  describe "::serializePackage(pack)", ->
    # afterEach ->
    #   atom.packages.unloadPackages()

    fit "does not serialize packages that have not been activated called on their main module", ->
      spyOn(console, 'warn')
      badPack = null
      waitsForPromise ->

        atom.packages.serializePackage(badPack)
        expect(badPack.mainModule.serialize).not.toHaveBeenCalled()

    it "absorbs exceptions that are thrown by the package module's serialize method", ->
      spyOn(console, 'error')

      waitsForPromise ->
