View Code? Open in Web Editor
NEW
Learning testing with Jest
hangmanwithjest's Introduction
Testing Hangman with Jest
- Clone this repository
- Make your own repository on GitHub
$ git remote set-url origin [email protected]:USERNAME/REPOSITORY.git
- Install Jest:
npm install --save-dev jest
- test
stringify
with toBe
- test
createBlankWordArray
with toEqual
- test
isWordSolved
with toBeTruthy
- explain
.not
- test with bad input to explain
toThrow
- test
print
with mocked console.log
- explain
toBeCalledWith
and toBeCalledTimes
- explain resetting a mock with
mockClear
- test
askForALetter
with mocked readline-sync
hangmanwithjest's People
Contributors
Watchers