JSFiddle - React, Tailwind, and code Playground

by mgiuffrida

HTML

<!-- master: No stack trace for async test. -->
<script src="https://rawgit.com/mochajs/mocha/master/mocha.js"></script>

<!--
proposal: Has stack trace for async test, similar to synchronous test.
<script src="https://rawgit.com/mgiuffrida/mocha/patch-1/mocha.js"></script>
-->
<div id="mocha"></div>

JavaScript

mocha.setup('bdd');

function doSomething() {
  console.log('doing something');
  throw new Error('some error')
}

describe('mocha', function() {
  it('throws synchronously', function() {
    doSomething();
  });
  it('throws async', function(done) {
    setTimeout(function() {
      doSomething();
      done();
    });
  });
});

mocha.run();