Skip to content

Instantly share code, notes, and snippets.

@werterzz
Last active August 21, 2022 06:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save werterzz/5f58c71b31a368b58d2ed52dea36a3bc to your computer and use it in GitHub Desktop.
Save werterzz/5f58c71b31a368b58d2ed52dea36a3bc to your computer and use it in GitHub Desktop.
const doYouLikeDog = (answer) => { // cover
if (answer === true) return "you like dogs." // cover
else if (answer === false) return "you don't like dogs." // cover
else return "you didn't answer my question." // not cover
} // cover
//-----------------------------------
test('pass true on doYouLikeDog()', () => {
expect(doYouLikeDog(true)).toBe("you like dogs.");
});
test('pass false on doYouLikeDog()', () => {
expect(doYouLikeDog(false)).toBe("you don't like dogs.");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment