whole_func_string: function listenForErrors() {
      window.addEventListener('error', function (event) {
          globalErrors.push(event.error);
      });
      // Also, we treat `console.error` as a test failure. Unless you prefer not.
      var origConsole = console;
      var origError = console.error;
      console.error = function wctShimmedError() {
          origError.apply(origConsole, arguments);
          if (get('trackConsoleError')) {
              throw 'console.error: ' + Array.prototype.join.call(arguments, ' ');
          }
      };
  }
func_code_string: function listenForErrors() {
      window.addEventListener('error', function (event) {
          globalErrors.push(event.error);
      });
      // Also, we treat `console.error` as a test failure. Unless you prefer not.
      var origConsole = console;
      var origError = console.error;
      console.error = function wctShimmedError() {
          origError.apply(origConsole, arguments);
          if (get('trackConsoleError')) {
              throw 'console.error: ' + Array.prototype.join.call(arguments, ' ');
          }
      };
  }
func_documentation_string: Hook the environment to pick up on global errors.