title: Detect runtime errors in CodeMirror to test documentation site deploy
body: <p>I have a React UI library that has a documentation site with interactive examples that run with CodeMirror + Babel.</p>
  
  <p>The examples are written within the library repository itself and are read by the client side JS (CodeMirror) of the documentation site when the page is loaded.</p>
  
  <p>I would like add tests to the project's CI server that runs when pull requests are created in order to guarantee the documentation site examples will run without deploying the documentation site itself.</p>
  
  <ul>
  <li>What would be the best way to go about this?</li>
  <li>Could it be implemented within a test framework like Mocha? I'd assume you could setup CodeMirror with text inside of it and then search the DOM for nodes that rendered.</li>
  <li>Would a try/catch statement be needed? I've not found a <code>hasError</code> API within CodeMirror. Errors tend to bubble up the into the console and block further rendering on the page.</li>
  </ul>