- fork and clone this repo
npm install
- run your tests by running
mocha
from the command line
- in your
numbers-tests.js
write tests for the following functions:add
(this is already provided to you as an example)filterEvens
takes an array (that could include any data type) and returns an array of only the even numberssecondSmallest
returns the second smallest number in an arrayuniqueNums
takes an array of numbers and returns only the unique numbers
- try running your tests. they should all fail at this point.
- complete the functions in the
js/numbers-funcs.js
file, one a time - after you complete each function import it into your test file
- run your tests to make sure your solution is correct
- in your
strings-tests.js
write tests for the following functions:capitalize
(this is already provided to you as an example)capitalizeFirst
takes an array of strings and returns a new string with the first letter of each string capitalizedOsToZeros
takes a string and returns a new string with all of the letter O's changed to the number 0countTheLetters
takes a string and returns an object with a count of the letters that appear in the string
- try running your tests. they should all fail at this point.
- complete the functions in the
js/strings-funcs.js
file, one a time - after you complete each function import it into your test file
- run your tests to make sure your solution is correct