           ]
           z: 'just a string!'
       @serialized = funcster.deepSerialize(@original)
-      done()
-
-    it 'should serialize deeply nested functions', (done) ->
+
+    it 'should serialize deeply nested functions', () ->
       @serialized.arr[0].__js_function.should.eql @original.arr[0].toString()
       @serialized.arr[3].__js_function.should.eql @original.arr[3].toString()
       @serialized.arr[4].foobar.__js_function.should.eql @original.arr[4].foobar.toString()
       @serialized.obj.a[0].b.c.__js_function.should.eql @original.obj.a[0].b.c.toString()
-      done()
-
-    it 'should retain non-function values', (done) ->
+
+    it 'should retain non-function values', () ->
       @serialized.arr[1].should.eql 'hello!'
       @serialized.arr[2].should.eql 1
       @serialized.arr[4].foo.should.eql 'bar'
       @serialized.obj.z.should.eql 'just a string!'
-      done()
 
   describe '_deepSelectSerializations()', () ->
 
-    before (done) ->
+    before () ->
       @selected = funcster._deepSelectSerializations(@serialized)
-      done()
-
-    it 'should collect all serialized functions', (done) ->
+
+    it 'should collect all serialized functions', () ->
       @selected.length.should.eql 4
-      done()
-
-    it 'should set paths correctly', (done) ->
+
+    it 'should set paths correctly', () ->
       @selected[0].path.should.eql [ 'arr', '0' ]
       @selected[1].path.should.eql [ 'arr', '3' ]
       @selected[2].path.should.eql [ 'arr', '4', 'foobar' ]
       @selected[3].path.should.eql [ 'obj', 'a', '0', 'b', 'c' ]
-      done()
 
   describe '_generateModuleScript()', () ->
 
-    it 'should encode functions into a text script', (done) ->
+    it 'should encode functions into a text script', () ->
       functions =
         'func_a': 'function(arg) { return arg; }'
         'func_b': 'function(arg) { return [ arg ]; }'
 
       script = funcster._generateModuleScript(functions)
-      script.should.eql 'module.exports=(function(global,module,exports){return{func_a: function(arg) { return arg; },func_b: function(arg) { return [ arg ]; }};})();'
-
-      done()
+      script.should.eql 'module.exports=(function(module,exports){return{func_a: function(arg) { return arg; },func_b: function(arg) { return [ arg ]; }};})();'
 
   describe '_generateModule()', () ->
 
-    it 'should export objects', (done) ->
+    it 'should export objects', () ->
       func = (arg) -> "Hello #{arg}!"
       script = "module.exports = { foo: #{func.toString()} }"
       moduleObj = funcster._generateModule(script)
       (moduleObj?).should.eql true
       (moduleObj.foo?).should.eql true
       moduleObj.foo('world').should.eql 'Hello world!'
-      done()
-
-    it 'should not include typical node.js globals by default', (done) ->
-      objects = [ 'process', 'require', 'setTimeout', 'clearTimeout',
+
+    it 'should not include typical node.js globals by default', () ->
+      objects = [ 'global', 'process', 'require', 'setTimeout', 'clearTimeout',
         'setInterval', 'clearInterval', 'console', 'Buffer', '__filename',
         '__dirname' ]
       functions = []

      moduleObj.String(new String).should.eql true
      moduleObj.Function(() ->).should.eql true
      moduleObj.Date(new Date).should.eql true
      done()

  describe 'deepDeserialize()', () ->

    before (done) ->
      @original =
        arr: [
          (arg) -> "Hello #{arg}!"

          z: 'just a string!'
      @serialized = funcster.deepSerialize(@original)
      @deserialized = funcster.deepDeserialize(@serialized)

    describe 'overloaded signature', () ->

      it 'one arg: root', () ->
        serialized = { __js_function: 'function() { return "hello" }' }
        deserialized = funcster.deepDeserialize(serialized)
        deserialized().should.eql 'hello'

      it 'two args: root, marker', () ->
        serialized = { CUSTOM_MARKER: 'function() { return "hello" }' }
        deserialized = funcster.deepDeserialize(serialized, 'CUSTOM_MARKER')
        deserialized().should.eql 'hello'

      it 'two args: root, moduleOpts', () ->
        serialized = { __js_function: 'function() { return foobar }' }
        deserialized = funcster.deepDeserialize(serialized, globals: { foobar: 'hello' })
        deserialized().should.eql 'hello'

      it 'three args: root, marker, moduleOpts', () ->
        serialized = { CUSTOM_MARKER: 'function() { return foobar }' }
        deserialized = funcster.deepDeserialize(serialized, 'CUSTOM_MARKER', globals: { foobar: 'hello' })
        deserialized().should.eql 'hello'

    it 'deserialized functions should work like unserialized versions', () ->
      @deserialized.arr[0]('world').should.eql @original.arr[0]('world')
      @deserialized.arr[3]('world').should.eql @original.arr[3]('world')
      @deserialized.arr[4].foobar('world').should.eql @original.arr[4].foobar('world')
      @deserialized.obj.a[0].b.c('world').should.eql @original.obj.a[0].b.c('world')

    it 'deserialized functions should not be copies of the unserialized versions', () ->
      # We use this slightly strange syntax because the functions in @deserialized
      # derive from an Object base class in a different context, so it has not
      # been extended by the should module.
