Skip to content

Instantly share code, notes, and snippets.

@Cst2989
Last active October 22, 2021 10:12
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 Cst2989/49af2209d53aa7ab2cedcdd326084b6f to your computer and use it in GitHub Desktop.
Save Cst2989/49af2209d53aa7ab2cedcdd326084b6f to your computer and use it in GitHub Desktop.
Adding happy path test
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