'use strict';

var test = require('tape')
var error = require('../')

test('catch', function(t) {
  t.plan(1)

  var MyError = error('MyError')

  var f
  f = function() {
    try {
      throw MyError()
    }
    catch (err) {}
  }
  t.doesNotThrow(f, MyError, 'Should catch MyError')
})

'use strict';

var test = require('tape')
var error = require('../')

test('catch', function(t) {
  t.plan(2)

  var MyError = error('MyError')

  try {
    throw MyError('faffy')
  }
  catch (err) {
    t.equals(err.name, 'MyError', 'should set error name correctly')
    t.equals(err.message, 'faffy', 'should set error message correctly')
  }
})

Make test/catch more meaningful