     ClassyTestCase.runOnServer @tearDownServer
     ClassyTestCase.runOnBoth @tearDown
 
+    # Test-local internal variables.
+    @_internal = {}
+
+    if Meteor.isClient
+      # Capture uncaught exceptions.
+      originalOnError = window.onerror
+      window.onerror = (args...) =>
+        @_onError args...
+        originalOnError.apply @, args if originalOnError
+
+      @_internal.capturedErrors = []
+      @_internal.currentErrors = 0
+
   @hasTests: ->
     ClassyTestCase._hasTests
 

        else
          testChain.push boundItem

  @getTestName: ->
    @testName


    ClassyTestCase._hasTests = true
    ClassyTestCase._testRegistry[testCase.getTestName()] = testCase

    testCase._internal.options = options

    # Register the test case.
    keys = (keys for keys, method of testCase)
