function runTest(testModule, testName) {
  try {
    if (typeof testModule.setUp === 'function') {
      testModule.setUp();
    }
  } catch (err) {
    window.console.log(`Setup for '${testName}' failed: ${err}`);
    window.console.log('Stacktrace:\n' + err.stack);
    throw new Error('Setup failed, aborting tests.');
  }

  // Run the test function.
  try {
    testModule[testName].call(testModule);
  } catch (err) {
    window.console.log(`Test '${testName}' failed: ${err}`);
    window.console.log('Stacktrace:\n' + err.stack);
    return false;
  }
  return true;
}
/**
 * Sets up the environment using the |testModule.setUp()| function
 * if it exists, and calls the function under test, |testModule[testName]|.
 * The setup function is assumed to be provided by the browser
 * test script. In case setup fails, the error is logged and another error
 * is raised, which will abort the test procedure in |runSimpleTests()|.
 * @param {!object} testModule The object that contains tests for a module
 *     (a property of |test|).
 * @param {!string} testName The name of the test function to run.
 * @return {boolean} True iff the test function succeeds (does not
 *     throw an error).
 */
Sets up the environment using the |testModule.setUp()| function
if it exists, and calls the function under test, |testModule[testName]|.
The setup function is assumed to be provided by the browser
test script. In case setup fails, the error is logged and another error
is raised, which will abort the test procedure in |runSimpleTests()|.
@param {!object} testModule The object that contains tests for a module
(a property of |test|).
@param {!string} testName The name of the test function to run.
@return {boolean} True iff the test function succeeds (does not
throw an error).
Sets up the environment using the |testModule . setUp () | function if it exists and calls the function under test |testModule [ testName ] | . The setup function is assumed to be provided by the browser test script . In case setup fails the error is logged and another error is raised which will abort the test procedure in |runSimpleTests () | . @param { !object } testModule The object that contains tests for a module ( a property of |test| ) . @param { !string } testName The name of the test function to run . @return { boolean } True iff the test function succeeds ( does not throw an error ) .
function runTest(testModule, testName) {
  try {
    if (typeof testModule.setUp === 'function') {
      testModule.setUp();
    }
  } catch (err) {
    window.console.log(`Setup for '${testName}' failed: ${err}`);
    window.console.log('Stacktrace:\n' + err.stack);
    throw new Error('Setup failed, aborting tests.');
  }
  try {
    testModule[testName].call(testModule);
  } catch (err) {
    window.console.log(`Test '${testName}' failed: ${err}`);
    window.console.log('Stacktrace:\n' + err.stack);
    return false;
  }
  return true;
}
function runTest ( testModule , testName ) { try { if ( typeof testModule . setUp === 'function' ) { testModule . setUp ( ) ; } } catch ( err ) { window . console . log ( ` ${ testName } ${ err } ` ) ; window . console . log ( 'Stacktrace:\n' + err . stack ) ; throw new Error ( 'Setup failed, aborting tests.' ) ; } try { testModule [ testName ] . call ( testModule ) ; } catch ( err ) { window . console . log ( ` ${ testName } ${ err } ` ) ; window . console . log ( 'Stacktrace:\n' + err . stack ) ; return false ; } return true ; }
Sets up the environment using the |testModule.setUp()| function
 if it exists, and calls the function under test, |testModule[testName]|.
Sets up the environment using the |testModule . setUp () | function if it exists and calls the function under test |testModule [ testName ] | .
// Run the test function.