From e7a2f32672d0bdb46ff833d8ac6434a4223d9ea6 Mon Sep 17 00:00:00 2001 From: jonschlinkert Date: Sun, 1 Mar 2015 00:54:45 -0500 Subject: [PATCH] fixes error test (before it was only testing that `should` can throw an error) --- test.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/test.js b/test.js index d1bb1ac..8f3083e 100644 --- a/test.js +++ b/test.js @@ -191,12 +191,9 @@ describe('gulp-routes', function() { }); it('should throw an error when a router is\'t provided.', function (done) { - try { - var routes = gulpRoutes(); - return done(new Error('Expected an error to be thrown')); - } catch (err) { - if (!err) return done(new Error('Expected an error to be thrown')); - done(); - } + (function () { + gulpRoutes() + }).should.throw('Expected a valid router object.'); + done(); }); });