From 3d96d171c5ada4eaa7544fe149c5556f79e12db4 Mon Sep 17 00:00:00 2001 From: Permutator Date: Sun, 15 Nov 2015 17:22:01 -0800 Subject: [PATCH] Fixed tests for rejection when not options or options.entry isn't passed --- test/test.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/test/test.js b/test/test.js index a4bd259..3599ae9 100644 --- a/test/test.js +++ b/test/test.js @@ -46,13 +46,19 @@ describe( 'rollup', function () { assert.equal( typeof rollup.rollup, 'function' ); }); - it( 'fails without options or options.entry', function () { - rollup.rollup().catch( function (err) { - assert( /must supply options\.entry/.test( err.toString() ) ); + it( 'fails without options', function () { + return rollup.rollup().then( function () { + throw new Error( 'Missing expected error' ); + }, function (err) { + assert.equal( 'You must supply options.entry to rollup', err.message ); }); + }); - rollup.rollup().catch( function (err) { - assert( /must supply options\.entry/.test( err.toString() ) ); + it( 'fails without options.entry', function () { + return rollup.rollup({}).then( function () { + throw new Error( 'Missing expected error' ); + }, function (err) { + assert.equal( 'You must supply options.entry to rollup', err.message ); }); }); });