File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -297,6 +297,22 @@ describe('LambdaLog', function() {
297297 assert . equal ( typeof res . then , 'function' ) ;
298298 } ) ;
299299
300+ it ( 'should throw an error when a promise is not provided' , function ( ) {
301+ assert . throws ( function ( ) {
302+ log . result ( ) ;
303+ } , function ( err ) {
304+ if ( ( err instanceof Error ) && err . message === 'A promise must be provided as the first argument' ) return true ;
305+ } ) ;
306+ } ) ;
307+
308+ it ( 'should throw an error when a non-valid promise is provided' , function ( ) {
309+ assert . throws ( function ( ) {
310+ log . result ( { } ) ;
311+ } , function ( err ) {
312+ if ( ( err instanceof Error ) && err . message === 'A promise must be provided as the first argument' ) return true ;
313+ } ) ;
314+ } ) ;
315+
300316 it ( 'should return a promise the resolves with log message' , function ( done ) {
301317 let promise = new Promise ( resolve => resolve ( 'test' ) ) ,
302318 res = log . result ( promise ) ;
You can’t perform that action at this time.
0 commit comments