uncaughtException

uncaughtException handle in mocha

Usage no npm install needed!

<script type="module">
  import uncaughtException from 'https://cdn.skypack.dev/uncaughtException';
</script>

README

uncaughtException

this module is used in mocha test.

it('should throw error xxx throws error', done => {
    uncaughtException((err) => {
      assert(err.message === 'xxx');
      done();
    });
    xxx();
});