Remove test skips for solutions

This commit is contained in:
thatblindgeye 2023-02-01 18:58:58 -05:00
parent 2ec0f4344d
commit e416717ba9
13 changed files with 80 additions and 80 deletions

View File

@ -4,19 +4,19 @@ describe('repeatString', () => {
test('repeats the string', () => { test('repeats the string', () => {
expect(repeatString('hey', 3)).toEqual('heyheyhey'); expect(repeatString('hey', 3)).toEqual('heyheyhey');
}); });
test.skip('repeats the string many times', () => { test('repeats the string many times', () => {
expect(repeatString('hey', 10)).toEqual('heyheyheyheyheyheyheyheyheyhey'); expect(repeatString('hey', 10)).toEqual('heyheyheyheyheyheyheyheyheyhey');
}); });
test.skip('repeats the string 1 times', () => { test('repeats the string 1 times', () => {
expect(repeatString('hey', 1)).toEqual('hey'); expect(repeatString('hey', 1)).toEqual('hey');
}); });
test.skip('repeats the string 0 times', () => { test('repeats the string 0 times', () => {
expect(repeatString('hey', 0)).toEqual(''); expect(repeatString('hey', 0)).toEqual('');
}); });
test.skip('returns ERROR with negative numbers', () => { test('returns ERROR with negative numbers', () => {
expect(repeatString('hey', -1)).toEqual('ERROR'); expect(repeatString('hey', -1)).toEqual('ERROR');
}); });
test.skip('repeats the string a random amount of times', function () { test('repeats the string a random amount of times', function () {
/*The number is generated by using Math.random to get a value from between /*The number is generated by using Math.random to get a value from between
0 to 1, when this is multiplied by 1000 and rounded down with Math.floor it 0 to 1, when this is multiplied by 1000 and rounded down with Math.floor it
equals a number between 0 to 999 (this number will change everytime you run equals a number between 0 to 999 (this number will change everytime you run
@ -33,7 +33,7 @@ describe('repeatString', () => {
number number
); );
}); });
test.skip('works with blank strings', () => { test('works with blank strings', () => {
expect(repeatString('', 10)).toEqual(''); expect(repeatString('', 10)).toEqual('');
}); });
}); });

View File

@ -5,14 +5,14 @@ describe('reverseString', () => {
expect(reverseString('hello')).toEqual('olleh'); expect(reverseString('hello')).toEqual('olleh');
}); });
test.skip('reverses multiple words', () => { test('reverses multiple words', () => {
expect(reverseString('hello there')).toEqual('ereht olleh'); expect(reverseString('hello there')).toEqual('ereht olleh');
}); });
test.skip('works with numbers and punctuation', () => { test('works with numbers and punctuation', () => {
expect(reverseString('123! abc!')).toEqual('!cba !321'); expect(reverseString('123! abc!')).toEqual('!cba !321');
}); });
test.skip('works with blank strings', () => { test('works with blank strings', () => {
expect(reverseString('')).toEqual(''); expect(reverseString('')).toEqual('');
}); });
}); });

View File

@ -4,22 +4,22 @@ describe('removeFromArray', () => {
test('removes a single value', () => { test('removes a single value', () => {
expect(removeFromArray([1, 2, 3, 4], 3)).toEqual([1, 2, 4]); expect(removeFromArray([1, 2, 3, 4], 3)).toEqual([1, 2, 4]);
}); });
test.skip('removes multiple values', () => { test('removes multiple values', () => {
expect(removeFromArray([1, 2, 3, 4], 3, 2)).toEqual([1, 4]); expect(removeFromArray([1, 2, 3, 4], 3, 2)).toEqual([1, 4]);
}); });
test.skip('ignores non present values', () => { test('ignores non present values', () => {
expect(removeFromArray([1, 2, 3, 4], 7, 'tacos')).toEqual([1, 2, 3, 4]); expect(removeFromArray([1, 2, 3, 4], 7, 'tacos')).toEqual([1, 2, 3, 4]);
}); });
test.skip('ignores non present values, but still works', () => { test('ignores non present values, but still works', () => {
expect(removeFromArray([1, 2, 3, 4], 7, 2)).toEqual([1, 3, 4]); expect(removeFromArray([1, 2, 3, 4], 7, 2)).toEqual([1, 3, 4]);
}); });
test.skip('can remove all values', () => { test('can remove all values', () => {
expect(removeFromArray([1, 2, 3, 4], 1, 2, 3, 4)).toEqual([]); expect(removeFromArray([1, 2, 3, 4], 1, 2, 3, 4)).toEqual([]);
}); });
test.skip('works with strings', () => { test('works with strings', () => {
expect(removeFromArray(['hey', 2, 3, 'ho'], 'hey', 3)).toEqual([2, 'ho']); expect(removeFromArray(['hey', 2, 3, 'ho'], 'hey', 3)).toEqual([2, 'ho']);
}); });
test.skip('only removes same type', () => { test('only removes same type', () => {
expect(removeFromArray([1, 2, 3], '1', 3)).toEqual([1, 2]); expect(removeFromArray([1, 2, 3], '1', 3)).toEqual([1, 2]);
}); });
}); });

View File

@ -4,22 +4,22 @@ describe('sumAll', () => {
test('sums numbers within the range', () => { test('sums numbers within the range', () => {
expect(sumAll(1, 4)).toEqual(10); expect(sumAll(1, 4)).toEqual(10);
}); });
test.skip('works with large numbers', () => { test('works with large numbers', () => {
expect(sumAll(1, 4000)).toEqual(8002000); expect(sumAll(1, 4000)).toEqual(8002000);
}); });
test.skip('works with larger number first', () => { test('works with larger number first', () => {
expect(sumAll(123, 1)).toEqual(7626); expect(sumAll(123, 1)).toEqual(7626);
}); });
test.skip('returns ERROR with negative numbers', () => { test('returns ERROR with negative numbers', () => {
expect(sumAll(-10, 4)).toEqual('ERROR'); expect(sumAll(-10, 4)).toEqual('ERROR');
}); });
test.skip('returns ERROR with non-integer parameters', () => { test('returns ERROR with non-integer parameters', () => {
expect(sumAll(2.5, 4)).toEqual('ERROR'); expect(sumAll(2.5, 4)).toEqual('ERROR');
}); });
test.skip('returns ERROR with non-number parameters', () => { test('returns ERROR with non-number parameters', () => {
expect(sumAll(10, '90')).toEqual('ERROR'); expect(sumAll(10, '90')).toEqual('ERROR');
}); });
test.skip('returns ERROR with non-number parameters', () => { test('returns ERROR with non-number parameters', () => {
expect(sumAll(10, [90, 1])).toEqual('ERROR'); expect(sumAll(10, [90, 1])).toEqual('ERROR');
}); });
}); });

View File

@ -4,19 +4,19 @@ describe('leapYears', () => {
test('works with non century years', () => { test('works with non century years', () => {
expect(leapYears(1996)).toBe(true); expect(leapYears(1996)).toBe(true);
}); });
test.skip('works with non century years', () => { test('works with non century years', () => {
expect(leapYears(1997)).toBe(false); expect(leapYears(1997)).toBe(false);
}); });
test.skip('works with ridiculously futuristic non century years', () => { test('works with ridiculously futuristic non century years', () => {
expect(leapYears(34992)).toBe(true); expect(leapYears(34992)).toBe(true);
}); });
test.skip('works with century years', () => { test('works with century years', () => {
expect(leapYears(1900)).toBe(false); expect(leapYears(1900)).toBe(false);
}); });
test.skip('works with century years', () => { test('works with century years', () => {
expect(leapYears(1600)).toBe(true); expect(leapYears(1600)).toBe(true);
}); });
test.skip('works with century years', () => { test('works with century years', () => {
expect(leapYears(700)).toBe(false); expect(leapYears(700)).toBe(false);
}); });
}); });

View File

@ -7,22 +7,22 @@ describe('convertToCelsius', () => {
test('works', () => { test('works', () => {
expect(convertToCelsius(32)).toEqual(0); expect(convertToCelsius(32)).toEqual(0);
}); });
test.skip('rounds to 1 decimal', () => { test('rounds to 1 decimal', () => {
expect(convertToCelsius(100)).toEqual(37.8); expect(convertToCelsius(100)).toEqual(37.8);
}); });
test.skip('works with negatives', () => { test('works with negatives', () => {
expect(convertToCelsius(-100)).toEqual(-73.3); expect(convertToCelsius(-100)).toEqual(-73.3);
}); });
}); });
describe('convertToFahrenheit', () => { describe('convertToFahrenheit', () => {
test.skip('works', () => { test('works', () => {
expect(convertToFahrenheit(0)).toEqual(32); expect(convertToFahrenheit(0)).toEqual(32);
}); });
test.skip('rounds to 1 decimal', () => { test('rounds to 1 decimal', () => {
expect(convertToFahrenheit(73.2)).toEqual(163.8); expect(convertToFahrenheit(73.2)).toEqual(163.8);
}); });
test.skip('works with negatives', () => { test('works with negatives', () => {
expect(convertToFahrenheit(-10)).toEqual(14); expect(convertToFahrenheit(-10)).toEqual(14);
}); });
}); });

View File

@ -5,73 +5,73 @@ describe('add', () => {
expect(calculator.add(0, 0)).toBe(0); expect(calculator.add(0, 0)).toBe(0);
}); });
test.skip('adds 2 and 2', () => { test('adds 2 and 2', () => {
expect(calculator.add(2, 2)).toBe(4); expect(calculator.add(2, 2)).toBe(4);
}); });
test.skip('adds positive numbers', () => { test('adds positive numbers', () => {
expect(calculator.add(2, 6)).toBe(8); expect(calculator.add(2, 6)).toBe(8);
}); });
}); });
describe('subtract', () => { describe('subtract', () => {
test.skip('subtracts numbers', () => { test('subtracts numbers', () => {
expect(calculator.subtract(10, 4)).toBe(6); expect(calculator.subtract(10, 4)).toBe(6);
}); });
}); });
describe('sum', () => { describe('sum', () => {
test.skip('computes the sum of an empty array', () => { test('computes the sum of an empty array', () => {
expect(calculator.sum([])).toBe(0); expect(calculator.sum([])).toBe(0);
}); });
test.skip('computes the sum of an array of one number', () => { test('computes the sum of an array of one number', () => {
expect(calculator.sum([7])).toBe(7); expect(calculator.sum([7])).toBe(7);
}); });
test.skip('computes the sum of an array of two numbers', () => { test('computes the sum of an array of two numbers', () => {
expect(calculator.sum([7, 11])).toBe(18); expect(calculator.sum([7, 11])).toBe(18);
}); });
test.skip('computes the sum of an array of many numbers', () => { test('computes the sum of an array of many numbers', () => {
expect(calculator.sum([1, 3, 5, 7, 9])).toBe(25); expect(calculator.sum([1, 3, 5, 7, 9])).toBe(25);
}); });
}); });
describe('multiply', () => { describe('multiply', () => {
test.skip('multiplies two numbers', () => { test('multiplies two numbers', () => {
expect(calculator.multiply([2, 4])).toBe(8); expect(calculator.multiply([2, 4])).toBe(8);
}); });
test.skip('multiplies several numbers', () => { test('multiplies several numbers', () => {
expect(calculator.multiply([2, 4, 6, 8, 10, 12, 14])).toBe(645120); expect(calculator.multiply([2, 4, 6, 8, 10, 12, 14])).toBe(645120);
}); });
}); });
describe('power', () => { describe('power', () => {
test.skip('raises one number to the power of another number', () => { test('raises one number to the power of another number', () => {
expect(calculator.power(4, 3)).toBe(64); // 4 to third power is 64 expect(calculator.power(4, 3)).toBe(64); // 4 to third power is 64
}); });
}); });
describe('factorial', () => { describe('factorial', () => {
test.skip('computes the factorial of 0', () => { test('computes the factorial of 0', () => {
expect(calculator.factorial(0)).toBe(1); // 0! = 1 expect(calculator.factorial(0)).toBe(1); // 0! = 1
}); });
test.skip('computes the factorial of 1', () => { test('computes the factorial of 1', () => {
expect(calculator.factorial(1)).toBe(1); expect(calculator.factorial(1)).toBe(1);
}); });
test.skip('computes the factorial of 2', () => { test('computes the factorial of 2', () => {
expect(calculator.factorial(2)).toBe(2); expect(calculator.factorial(2)).toBe(2);
}); });
test.skip('computes the factorial of 5', () => { test('computes the factorial of 5', () => {
expect(calculator.factorial(5)).toBe(120); expect(calculator.factorial(5)).toBe(120);
}); });
test.skip('computes the factorial of 10', () => { test('computes the factorial of 10', () => {
expect(calculator.factorial(10)).toBe(3628800); expect(calculator.factorial(10)).toBe(3628800);
}); });
}); });

View File

@ -4,21 +4,21 @@ describe('palindromes', () => {
test('works with single words', () => { test('works with single words', () => {
expect(palindromes('racecar')).toBe(true); expect(palindromes('racecar')).toBe(true);
}); });
test.skip('works with punctuation ', () => { test('works with punctuation ', () => {
expect(palindromes('racecar!')).toBe(true); expect(palindromes('racecar!')).toBe(true);
}); });
test.skip('works with upper-case letters ', () => { test('works with upper-case letters ', () => {
expect(palindromes('Racecar!')).toBe(true); expect(palindromes('Racecar!')).toBe(true);
}); });
test.skip('works with multiple words', () => { test('works with multiple words', () => {
expect(palindromes('A car, a man, a maraca.')).toBe(true); expect(palindromes('A car, a man, a maraca.')).toBe(true);
}); });
test.skip('works with multiple words', () => { test('works with multiple words', () => {
expect(palindromes('Animal loots foliated detail of stool lamina.')).toBe( expect(palindromes('Animal loots foliated detail of stool lamina.')).toBe(
true true
); );
}); });
test.skip("doesn't just always return true", () => { test("doesn't just always return true", () => {
expect(palindromes('ZZZZ car, a man, a maraca.')).toBe(false); expect(palindromes('ZZZZ car, a man, a maraca.')).toBe(false);
}); });
}); });

View File

@ -4,28 +4,28 @@ describe('fibonacci', () => {
test('4th fibonacci number is 3', () => { test('4th fibonacci number is 3', () => {
expect(fibonacci(4)).toBe(3); expect(fibonacci(4)).toBe(3);
}); });
test.skip('6th fibonacci number is 8', () => { test('6th fibonacci number is 8', () => {
expect(fibonacci(6)).toBe(8); expect(fibonacci(6)).toBe(8);
}); });
test.skip('10th fibonacci number is 55', () => { test('10th fibonacci number is 55', () => {
expect(fibonacci(10)).toBe(55); expect(fibonacci(10)).toBe(55);
}); });
test.skip('15th fibonacci number is 610', () => { test('15th fibonacci number is 610', () => {
expect(fibonacci(15)).toBe(610); expect(fibonacci(15)).toBe(610);
}); });
test.skip('25th fibonacci number is 75025', () => { test('25th fibonacci number is 75025', () => {
expect(fibonacci(25)).toBe(75025); expect(fibonacci(25)).toBe(75025);
}); });
test.skip("doesn't accept negatives", () => { test("doesn't accept negatives", () => {
expect(fibonacci(-25)).toBe('OOPS'); expect(fibonacci(-25)).toBe('OOPS');
}); });
test.skip('DOES accept strings', () => { test('DOES accept strings', () => {
expect(fibonacci('1')).toBe(1); expect(fibonacci('1')).toBe(1);
}); });
test.skip('DOES accept strings', () => { test('DOES accept strings', () => {
expect(fibonacci('2')).toBe(1); expect(fibonacci('2')).toBe(1);
}); });
test.skip('DOES accept strings', () => { test('DOES accept strings', () => {
expect(fibonacci('8')).toBe(21); expect(fibonacci('8')).toBe(21);
}); });
}); });

View File

@ -21,7 +21,7 @@ describe('findTheOldest', () => {
]; ];
expect(findTheOldest(people).name).toBe('Ray'); expect(findTheOldest(people).name).toBe('Ray');
}); });
test.skip('finds the oldest person if someone is still living', () => { test('finds the oldest person if someone is still living', () => {
const people = [ const people = [
{ {
name: 'Carly', name: 'Carly',
@ -40,7 +40,7 @@ describe('findTheOldest', () => {
]; ];
expect(findTheOldest(people).name).toBe('Ray'); expect(findTheOldest(people).name).toBe('Ray');
}); });
test.skip('finds the oldest person if the OLDEST is still living', () => { test('finds the oldest person if the OLDEST is still living', () => {
const people = [ const people = [
{ {
name: 'Carly', name: 'Carly',

View File

@ -3,21 +3,21 @@ const caesar = require('./caesar-solution');
test('works with single letters', () => { test('works with single letters', () => {
expect(caesar('A', 1)).toBe('B'); expect(caesar('A', 1)).toBe('B');
}); });
test.skip('works with words', () => { test('works with words', () => {
expect(caesar('Aaa', 1)).toBe('Bbb'); expect(caesar('Aaa', 1)).toBe('Bbb');
}); });
test.skip('works with phrases', () => { test('works with phrases', () => {
expect(caesar('Hello, World!', 5)).toBe('Mjqqt, Btwqi!'); expect(caesar('Hello, World!', 5)).toBe('Mjqqt, Btwqi!');
}); });
test.skip('works with negative shift', () => { test('works with negative shift', () => {
expect(caesar('Mjqqt, Btwqi!', -5)).toBe('Hello, World!'); expect(caesar('Mjqqt, Btwqi!', -5)).toBe('Hello, World!');
}); });
test.skip('wraps', () => { test('wraps', () => {
expect(caesar('Z', 1)).toBe('A'); expect(caesar('Z', 1)).toBe('A');
}); });
test.skip('works with large shift factors', () => { test('works with large shift factors', () => {
expect(caesar('Hello, World!', 75)).toBe('Ebiil, Tloia!'); expect(caesar('Hello, World!', 75)).toBe('Ebiil, Tloia!');
}); });
test.skip('works with large negative shift factors', () => { test('works with large negative shift factors', () => {
expect(caesar('Hello, World!', -29)).toBe('Ebiil, Tloia!'); expect(caesar('Hello, World!', -29)).toBe('Ebiil, Tloia!');
}); });

View File

@ -22,35 +22,35 @@ describe('translate', () => {
expect(pigLatin('apple')).toBe('appleay'); expect(pigLatin('apple')).toBe('appleay');
}); });
test.skip('translates a word beginning with a consonant', () => { test('translates a word beginning with a consonant', () => {
expect(pigLatin('banana')).toBe('ananabay'); expect(pigLatin('banana')).toBe('ananabay');
}); });
test.skip('translates a word beginning with two consonants', () => { test('translates a word beginning with two consonants', () => {
expect(pigLatin('cherry')).toBe('errychay'); expect(pigLatin('cherry')).toBe('errychay');
}); });
test.skip('translates two words', () => { test('translates two words', () => {
expect(pigLatin('eat pie')).toBe('eatay iepay'); expect(pigLatin('eat pie')).toBe('eatay iepay');
}); });
test.skip('translates a word beginning with three consonants', () => { test('translates a word beginning with three consonants', () => {
expect(pigLatin('three')).toBe('eethray'); expect(pigLatin('three')).toBe('eethray');
}); });
test.skip('counts "sch" as a single phoneme', () => { test('counts "sch" as a single phoneme', () => {
expect(pigLatin('school')).toBe('oolschay'); expect(pigLatin('school')).toBe('oolschay');
}); });
test.skip('counts "qu" as a single phoneme', () => { test('counts "qu" as a single phoneme', () => {
expect(pigLatin('quiet')).toBe('ietquay'); expect(pigLatin('quiet')).toBe('ietquay');
}); });
test.skip('counts "qu" as a consonant even when its preceded by a consonant', () => { test('counts "qu" as a consonant even when its preceded by a consonant', () => {
expect(pigLatin('square')).toBe('aresquay'); expect(pigLatin('square')).toBe('aresquay');
}); });
test.skip('translates many words', () => { test('translates many words', () => {
expect(pigLatin('the quick brown fox')).toBe('ethay ickquay ownbray oxfay'); expect(pigLatin('the quick brown fox')).toBe('ethay ickquay ownbray oxfay');
}); });
}); });

View File

@ -4,21 +4,21 @@ describe('snakeCase', () => {
test('works with simple lowercased phrases', () => { test('works with simple lowercased phrases', () => {
expect(snakeCase('hello world')).toEqual('hello_world'); expect(snakeCase('hello world')).toEqual('hello_world');
}); });
test.skip('works with Caps and punctuation', () => { test('works with Caps and punctuation', () => {
expect(snakeCase('Hello, World???')).toEqual('hello_world'); expect(snakeCase('Hello, World???')).toEqual('hello_world');
}); });
test.skip('works with longer phrases', () => { test('works with longer phrases', () => {
expect(snakeCase('This is the song that never ends....')).toEqual( expect(snakeCase('This is the song that never ends....')).toEqual(
'this_is_the_song_that_never_ends' 'this_is_the_song_that_never_ends'
); );
}); });
test.skip('works with camel case', () => { test('works with camel case', () => {
expect(snakeCase('snakeCase')).toEqual('snake_case'); expect(snakeCase('snakeCase')).toEqual('snake_case');
}); });
test.skip('works with kebab case', () => { test('works with kebab case', () => {
expect(snakeCase('snake-case')).toEqual('snake_case'); expect(snakeCase('snake-case')).toEqual('snake_case');
}); });
test.skip('works with WTF case', () => { test('works with WTF case', () => {
expect(snakeCase('SnAkE..CaSe..Is..AwEsOmE')).toEqual( expect(snakeCase('SnAkE..CaSe..Is..AwEsOmE')).toEqual(
'snake_case_is_awesome' 'snake_case_is_awesome'
); );