Skip to content

Instantly share code, notes, and snippets.

@werterzz
Created August 21, 2022 07:39
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/92728283302e01188d4085011cf7e703 to your computer and use it in GitHub Desktop.
Save werterzz/92728283302e01188d4085011cf7e703 to your computer and use it in GitHub Desktop.
const doYouLikeDog = (answer) => {
return answer === true ? "you like dogs." : answer === false ? "you don't like dogs." : "you didn't answer my question."
}
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