use mocha and add errorHandler tests