Skip to content

Commit

Permalink
Updating tests bowling (#2579)
Browse files Browse the repository at this point in the history
  • Loading branch information
jagdish-15 authored Jan 6, 2025
1 parent 98c621a commit 4cb770c
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
1 change: 1 addition & 0 deletions exercises/practice/bowling/.meta/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
],
"contributors": [
"danielj-jordan",
"jagdish-15",
"SleeplessByte",
"tejasbubane"
],
Expand Down
16 changes: 13 additions & 3 deletions exercises/practice/bowling/.meta/tests.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# This is an auto-generated file. Regular comments will be removed when this
# file is regenerated. Regenerating will not touch any manually added keys,
# so comments can be added in a "comment" key.
# This is an auto-generated file.
#
# Regenerating this file via `configlet sync` will:
# - Recreate every `description` key/value pair
# - Recreate every `reimplements` key/value pair, where they exist in problem-specifications
# - Remove any `include = true` key/value pair (an omitted `include` key implies inclusion)
# - Preserve any other key/value pair
#
# As user-added comments (using the # character) will be removed when this file
# is regenerated, comments can be added via a `comment` key.

[656ae006-25c2-438c-a549-f338e7ec7441]
description = "should be able to score a game with all zeros"
Expand Down Expand Up @@ -38,6 +45,9 @@ description = "rolling a spare with the two roll bonus does not get a bonus roll
[576faac1-7cff-4029-ad72-c16bcada79b5]
description = "strikes with the two roll bonus do not get bonus rolls"

[efb426ec-7e15-42e6-9b96-b4fca3ec2359]
description = "last two strikes followed by only last bonus with non strike points"

[72e24404-b6c6-46af-b188-875514c0377b]
description = "a strike with the one roll bonus after a spare in the last frame does not get a bonus"

Expand Down
11 changes: 11 additions & 0 deletions exercises/practice/bowling/bowling.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,17 @@ describe('Bowling', () => {
expect(bowling.score()).toEqual(30);
});

xtest('last two strikes followed by only last bonus with non strike points', () => {
const rolls = [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 0, 1,
];
const bowling = new Bowling();
rolls.forEach((roll) => {
bowling.roll(roll);
});
expect(bowling.score()).toEqual(31);
});

xtest('a strike with the one roll bonus after a spare in the last frame does not get a bonus', () => {
const rolls = [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 3, 10,
Expand Down

0 comments on commit 4cb770c

Please sign in to comment.