Created
October 22, 2021 10:34
-
-
Save Cst2989/72883982bbe94adc7f085b09c288f534 to your computer and use it in GitHub Desktop.
total score 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
describe('totalScore function', () => { | |
test('it should return total score when no spares/strike', () => { | |
const scoreCard = '2222222222' | |
const totalScore = totalScore(scoreCard); | |
expect(totalScore).toBe(20); | |
}); | |
test('it should return total score when we have spares', () => { | |
const scoreCard = '/2222222/2' | |
const totalScore = totalScore(scoreCard); | |
expect(totalScore).toBe(38); | |
}); | |
test('it should return total score when we have spares and strike', () => { | |
const scoreCard = '/2X22222/2' | |
const totalScore = totalScore(scoreCard); | |
expect(totalScore).toBe(48); | |
}); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment