test/helpers.js
/**
 * Test an async function
 *
 * A convenience function that provides better
 * handling of errors when testing async functions
 *
 * @param  {String} name Name of test
 * @param  {Function} func Async test function
 */
Test an async function
A convenience function that provides better
handling of errors when testing async functions

@param  {String} name Name of test
@param  {Function} func Async test function
Test an async function A convenience function that provides better handling of errors when testing async functions @param { String } name Name of test @param { Function } func Async test function
function testAsync (name, func) {
  test(name, async assert => {
    try {
      await func(assert)
    } catch (error) {
      assert.fail(error.message)
      console.error(error)
      assert.end()
    }
  })
}
function testAsync ( name , func ) { test ( name , async assert => { try { await func ( assert ) } catch ( error ) { assert . fail ( error . message ) console . error ( error ) assert . end ( ) } } ) }
Test an async function
 A convenience function that provides better
 handling of errors when testing async functions
Test an async function A convenience function that provides better handling of errors when testing async functions