         runs ->
           expect(client.isWorking()).toBe(false)
 
-    it "can handle a large number of callbacks", ->
+      it "emits a done event", ->
+        expect(doneSpy.calls.length).toBe(1)
+
+    it "can handle a large number of concurrent callbacks", ->
       n = 1000
       cbs = (evalsimple("sleep(rand()); #{i}^2") for i in [0...n])
+      t = new Date().getTime()
       for i in [0...n]
         do (i) ->
           waitsForPromise ->
             cbs[i].then (result) -> expect(result).toBe(Math.pow(i, 2))
+      runs ->
+        expect(new Date().getTime() - t).toBeLessThan(1500)
 
   describe "when the process is shut down", ->
 

          expect(x).toBe(2)

    describe "when callbacks are pending", ->
      cbs = null
      it "enters loading state", ->
        cbs = (evalsimple("peakflops(1000)") for i in [1..5])
        expect(client.isWorking()).toBe(true)

      it "stops loading after they are done", ->
        for cb in cbs

    it "recognises the client's state after boot", ->
      expect(clientStatus()).toEqual [true, true, false]

    it "emits a connection event", ->
      expect(connectSpy.calls.length).toBe(1)

  describe "while the client is active", ->

    it "can send and receive nested objects, strings and arrays", ->
