From 6c821829d09362890061cc11bf4a62c4f0558109 Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Thu, 1 Nov 2018 15:05:16 +0200 Subject: [PATCH] Additional tests --- test/binomialCoefficient.test.js | 6 ++++++ test/colorize.test.js | 3 +++ 2 files changed, 9 insertions(+) diff --git a/test/binomialCoefficient.test.js b/test/binomialCoefficient.test.js index 894c006bd..1e6d8003f 100644 --- a/test/binomialCoefficient.test.js +++ b/test/binomialCoefficient.test.js @@ -13,6 +13,12 @@ test('Returns the appropriate value', () => { test('Returns the appropriate value', () => { expect(binomialCoefficient(5, 3)).toBe(10); }); +test('Returns the appropriate value', () => { + expect(binomialCoefficient(8, -1)).toBe(0); +}); +test('Returns the appropriate value', () => { + expect(binomialCoefficient(8, 1)).toBe(8); +}); test('Returns NaN', () => { expect(Number.isNaN(binomialCoefficient(NaN, 3))).toBeTruthy(); }); diff --git a/test/colorize.test.js b/test/colorize.test.js index 8e147ef2e..4e9e17dc7 100644 --- a/test/colorize.test.js +++ b/test/colorize.test.js @@ -4,3 +4,6 @@ const {colorize} = require('./_30s.js'); test('colorize is a Function', () => { expect(colorize).toBeInstanceOf(Function); }); +test('Returns the appropriate value', () => { + expect(colorize('x').black).toBe('\x1b[30mx'); +});