Skip to content

Commit e0033f3

Browse files
authored
Update tests high scores (#2689)
* Syncing toml file * Updating test file * Configuring config.json * Running format.mjs
1 parent ca83643 commit e0033f3

File tree

3 files changed

+56
-8
lines changed

3 files changed

+56
-8
lines changed

exercises/practice/high-scores/.meta/config.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"cmccandless",
88
"ffflorian",
99
"hayashi-ay",
10+
"jagdish-15",
1011
"SleeplessByte"
1112
],
1213
"files": {
Lines changed: 27 additions & 8 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
[1035eb93-2208-4c22-bab8-fef06769a73c]
613
description = "List of scores"
@@ -12,16 +19,28 @@ description = "Latest score"
1219
description = "Personal best"
1320

1421
[3d996a97-c81c-4642-9afc-80b80dc14015]
15-
description = "Personal top three from a list of scores"
22+
description = "Top 3 scores -> Personal top three from a list of scores"
1623

1724
[1084ecb5-3eb4-46fe-a816-e40331a4e83a]
18-
description = "Personal top highest to lowest"
25+
description = "Top 3 scores -> Personal top highest to lowest"
1926

2027
[e6465b6b-5a11-4936-bfe3-35241c4f4f16]
21-
description = "Personal top when there is a tie"
28+
description = "Top 3 scores -> Personal top when there is a tie"
2229

2330
[f73b02af-c8fd-41c9-91b9-c86eaa86bce2]
24-
description = "Personal top when there are less than 3"
31+
description = "Top 3 scores -> Personal top when there are less than 3"
2532

2633
[16608eae-f60f-4a88-800e-aabce5df2865]
27-
description = "Personal top when there is only one"
34+
description = "Top 3 scores -> Personal top when there is only one"
35+
36+
[2df075f9-fec9-4756-8f40-98c52a11504f]
37+
description = "Top 3 scores -> Latest score after personal top scores"
38+
39+
[809c4058-7eb1-4206-b01e-79238b9b71bc]
40+
description = "Top 3 scores -> Scores after personal top scores"
41+
42+
[ddb0efc0-9a86-4f82-bc30-21ae0bdc6418]
43+
description = "Top 3 scores -> Latest score after personal best"
44+
45+
[6a0fd2d1-4cc4-46b9-a5bb-2fb667ca2364]
46+
description = "Top 3 scores -> Scores after personal best"

exercises/practice/high-scores/high-scores.spec.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,33 @@ describe('High Scores Test Suite', () => {
4242
const input = [40];
4343
expect(new HighScores(input).personalTopThree).toEqual([40]);
4444
});
45+
46+
xtest('Latest score after personal top scores', () => {
47+
const input = [70, 50, 20, 30];
48+
const highScores = new HighScores(input);
49+
highScores.personalTopThree;
50+
expect(highScores.latest).toEqual(30);
51+
});
52+
53+
xtest('Scores after personal top scores', () => {
54+
const input = [30, 50, 20, 70];
55+
const highScores = new HighScores(input);
56+
highScores.personalTopThree;
57+
expect(highScores.scores).toEqual(input);
58+
});
59+
60+
xtest('Latest score after personal best', () => {
61+
const input = [20, 70, 15, 25, 30];
62+
const highScores = new HighScores(input);
63+
highScores.personalBest;
64+
expect(highScores.latest).toEqual(30);
65+
});
66+
67+
xtest('Scores after personal best', () => {
68+
const input = [20, 70, 15, 25, 30];
69+
const highScores = new HighScores(input);
70+
highScores.personalBest;
71+
expect(highScores.scores).toEqual(input);
72+
});
4573
});
4674
});

0 commit comments

Comments
 (0)