Skip to content

Commit c5b5af7

Browse files
committed
test: add additional tests for log.result()
1 parent 0af244d commit c5b5af7

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

test/lambdaLog.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff 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);

0 commit comments

Comments
 (0)