function doTestMessage(failFunc, expectedMsg) {
  const error = assertThrows('failFunc should throw.', failFunc);
  // Test error message.
  assertEquals(expectedMsg, error.message);
}
Test that the function throws an error with the given message.
@param {function()} failFunc
@param {string} expectedMsg