Additional tests

This commit is contained in:
Angelos Chalaris
2018-11-01 15:05:16 +02:00
parent e49fa91c95
commit f818454b3a
2 changed files with 9 additions and 0 deletions

View File

@ -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();
});

View File

@ -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');
});