Skip to content

Commit 4cb770c

Browse files
authored
Updating tests bowling (#2579)
1 parent 98c621a commit 4cb770c

File tree

3 files changed

+25
-3
lines changed

3 files changed

+25
-3
lines changed

exercises/practice/bowling/.meta/config.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
],
55
"contributors": [
66
"danielj-jordan",
7+
"jagdish-15",
78
"SleeplessByte",
89
"tejasbubane"
910
],

exercises/practice/bowling/.meta/tests.toml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
1-
# This is an auto-generated file. Regular comments will be removed when this
2-
# file is regenerated. Regenerating will not touch any manually added keys,
3-
# so comments can be added in a "comment" key.
1+
# This is an auto-generated file.
2+
#
3+
# Regenerating this file via `configlet sync` will:
4+
# - Recreate every `description` key/value pair
5+
# - Recreate every `reimplements` key/value pair, where they exist in problem-specifications
6+
# - Remove any `include = true` key/value pair (an omitted `include` key implies inclusion)
7+
# - Preserve any other key/value pair
8+
#
9+
# As user-added comments (using the # character) will be removed when this file
10+
# is regenerated, comments can be added via a `comment` key.
411

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

48+
[efb426ec-7e15-42e6-9b96-b4fca3ec2359]
49+
description = "last two strikes followed by only last bonus with non strike points"
50+
4151
[72e24404-b6c6-46af-b188-875514c0377b]
4252
description = "a strike with the one roll bonus after a spare in the last frame does not get a bonus"
4353

exercises/practice/bowling/bowling.spec.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,17 @@ describe('Bowling', () => {
129129
expect(bowling.score()).toEqual(30);
130130
});
131131

132+
xtest('last two strikes followed by only last bonus with non strike points', () => {
133+
const rolls = [
134+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 0, 1,
135+
];
136+
const bowling = new Bowling();
137+
rolls.forEach((roll) => {
138+
bowling.roll(roll);
139+
});
140+
expect(bowling.score()).toEqual(31);
141+
});
142+
132143
xtest('a strike with the one roll bonus after a spare in the last frame does not get a bonus', () => {
133144
const rolls = [
134145
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 3, 10,

0 commit comments

Comments
 (0)