Created
October 22, 2021 09:57
-
-
Save Cst2989/2133174ad0181f0feeae0749381d63dd to your computer and use it in GitHub Desktop.
calculateFrame testing
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('calculateFrame function', () => { | |
test('it should return error message for non-zero number after strike', () => { | |
const firstRoll = 10; // strike | |
const secondRoll = 1; // invalid input | |
const frameScore = calculateFrame(firstRoll, secondRoll); | |
expect(frameScore).toBe('Invalid frame input'); | |
}); | |
test('it should return error message sum in frame is bigger than 10', () => { | |
const firstRoll = 7; | |
const secondRoll = 5; // invalid input | |
const frameScore = calculateFrame(firstRoll, secondRoll); | |
expect(frameScore).toBe('Invalid frame input'); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment