Last active
November 17, 2019 07:12
-
-
Save taingmeng/cb8ad35767ab5373f5262e5b9d3c476c to your computer and use it in GitHub Desktop.
Bad example of not enough test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// whoLikeThis.js | |
const whoLikeThis = (names) => { | |
return `${names[0]} and ${names.length - 1} others liked this`; | |
}; | |
// whoLikeThis.test.js | |
it('should return the first person name and count of the rest`, () => { | |
const output = whoLikeThis(['Sarah', 'Michael', 'Jane']); | |
expect(output).toEqual('Sarach and 2 others liked this'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment