Last active
October 22, 2021 10:12
-
-
Save Cst2989/49af2209d53aa7ab2cedcdd326084b6f to your computer and use it in GitHub Desktop.
Adding happy path test
This file contains 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
test('it should return the sum of the rolls', () => { | |
const firstRoll = 7 | |
const secondRoll = 2 | |
const frameScore = calculateFrame(firstRoll, secondRoll); | |
expect(frameScore).toBe(9); | |
}); | |
test('it should return the / sign if the players hit a spare', () => { | |
const firstRoll = 7 | |
const secondRoll = 3 | |
const score = calculateFrame(firstRoll, secondRoll); | |
expect(score).toBe('/'); | |
}); | |
test('it should return the X sign if the players hit a strike', () => { | |
const firstRoll = 10 | |
const secondRoll = 0 | |
const score = calculateFrame(firstRoll, secondRoll); | |
expect(score).toBe('X'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment