From 80b42c56e544b4a3a64df3dc6ef4efe187256417 Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Wed, 7 Nov 2018 15:16:14 +0200 Subject: [PATCH] Additional tests --- test/isPromiseLike.test.js | 3 +++ test/mostPerformant.test.js | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/test/isPromiseLike.test.js b/test/isPromiseLike.test.js index eabc7fb80..7bf5b9af3 100644 --- a/test/isPromiseLike.test.js +++ b/test/isPromiseLike.test.js @@ -16,3 +16,6 @@ test('Returns true for a promise-like object', () => { test('Returns false for an empty object', () => { expect(isPromiseLike({})).toBeFalsy(); }); +test('Returns false for a normal function', () => { + expect(isPromiseLike(Math.max)).toBeFalsy(); +}); diff --git a/test/mostPerformant.test.js b/test/mostPerformant.test.js index 28f2b46dd..ca61d403f 100644 --- a/test/mostPerformant.test.js +++ b/test/mostPerformant.test.js @@ -4,3 +4,9 @@ const {mostPerformant} = require('./_30s.js'); test('mostPerformant is a Function', () => { expect(mostPerformant).toBeInstanceOf(Function); }); +test('mostPerformant returns a number', () => { + expect(typeof mostPerformant([Math.max, Math.min])).toBe('number'); +}); +test('mostPerformant returns a number', () => { + expect(typeof mostPerformant([Math.max, Math.min], 10)).toBe('number'); +});