Skip to content

Commit c6ff2ba

Browse files
authored
Update tests strain (#2764)
1 parent 724cafd commit c6ff2ba

File tree

3 files changed

+64
-3
lines changed

3 files changed

+64
-3
lines changed

exercises/practice/strain/.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
"ankorGH",
7+
"jagdish-15",
78
"rchavarria",
89
"ryanplusplus",
910
"SleeplessByte",
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
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.
11+
12+
[26af8c32-ba6a-4eb3-aa0a-ebd8f136e003]
13+
description = "keep on empty list returns empty list"
14+
15+
[f535cb4d-e99b-472a-bd52-9fa0ffccf454]
16+
description = "keeps everything"
17+
18+
[950b8e8e-f628-42a8-85e2-9b30f09cde38]
19+
description = "keeps nothing"
20+
21+
[92694259-6e76-470c-af87-156bdf75018a]
22+
description = "keeps first and last"
23+
24+
[938f7867-bfc7-449e-a21b-7b00cbb56994]
25+
description = "keeps neither first nor last"
26+
27+
[8908e351-4437-4d2b-a0f7-770811e48816]
28+
description = "keeps strings"
29+
30+
[2728036b-102a-4f1e-a3ef-eac6160d876a]
31+
description = "keeps lists"
32+
33+
[ef16beb9-8d84-451a-996a-14e80607fce6]
34+
description = "discard on empty list returns empty list"
35+
36+
[2f42f9bc-8e06-4afe-a222-051b5d8cd12a]
37+
description = "discards everything"
38+
39+
[ca990fdd-08c2-4f95-aa50-e0f5e1d6802b]
40+
description = "discards nothing"
41+
42+
[71595dae-d283-48ca-a52b-45fa96819d2f]
43+
description = "discards first and last"
44+
45+
[ae141f79-f86d-4567-b407-919eaca0f3dd]
46+
description = "discards neither first nor last"
47+
48+
[daf25b36-a59f-4f29-bcfe-302eb4e43609]
49+
description = "discards strings"
50+
51+
[a38d03f9-95ad-4459-80d1-48e937e4acaf]
52+
description = "discards lists"

exercises/practice/strain/strain.spec.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ describe('strain', () => {
1010
expect(keep([1, 2, 3], (e) => e < 10)).toEqual([1, 2, 3]);
1111
});
1212

13+
xtest('keeps nothing', () => {
14+
expect(keep([1, 2, 3], (e) => e > 10)).toEqual([]);
15+
});
16+
1317
xtest('keeps first and last', () => {
1418
expect(keep([1, 2, 3], (e) => e % 2 === 1)).toEqual([1, 3]);
1519
});
@@ -24,7 +28,7 @@ describe('strain', () => {
2428
expect(result).toEqual('zebra zombies zelot'.split(' '));
2529
});
2630

27-
xtest('keeps arrays', () => {
31+
xtest('keeps lists', () => {
2832
const rows = [
2933
[1, 2, 3],
3034
[5, 5, 5],
@@ -43,10 +47,14 @@ describe('strain', () => {
4347
]);
4448
});
4549

46-
xtest('empty discard', () => {
50+
xtest('discards everything', () => {
4751
expect(discard([], (e) => e < 10)).toEqual([]);
4852
});
4953

54+
xtest('discards everything', () => {
55+
expect(discard([1, 3, 5], (e) => e < 10)).toEqual([]);
56+
});
57+
5058
xtest('discards nothing', () => {
5159
expect(discard([1, 2, 3], (e) => e > 10)).toEqual([1, 2, 3]);
5260
});
@@ -66,7 +74,7 @@ describe('strain', () => {
6674
expect(result).toEqual('apple banana cherimoya'.split(' '));
6775
});
6876

69-
xtest('discards arrays', () => {
77+
xtest('discards lists', () => {
7078
const rows = [
7179
[1, 2, 3],
7280
[5, 5, 5],

0 commit comments

Comments
 (0)