diff --git a/exercises/practice/strain/.meta/config.json b/exercises/practice/strain/.meta/config.json index 60e96d4433..fe47034587 100644 --- a/exercises/practice/strain/.meta/config.json +++ b/exercises/practice/strain/.meta/config.json @@ -4,6 +4,7 @@ ], "contributors": [ "ankorGH", + "jagdish-15", "rchavarria", "ryanplusplus", "SleeplessByte", diff --git a/exercises/practice/strain/.meta/tests.toml b/exercises/practice/strain/.meta/tests.toml new file mode 100644 index 0000000000..3a617b4a92 --- /dev/null +++ b/exercises/practice/strain/.meta/tests.toml @@ -0,0 +1,52 @@ +# 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. + +[26af8c32-ba6a-4eb3-aa0a-ebd8f136e003] +description = "keep on empty list returns empty list" + +[f535cb4d-e99b-472a-bd52-9fa0ffccf454] +description = "keeps everything" + +[950b8e8e-f628-42a8-85e2-9b30f09cde38] +description = "keeps nothing" + +[92694259-6e76-470c-af87-156bdf75018a] +description = "keeps first and last" + +[938f7867-bfc7-449e-a21b-7b00cbb56994] +description = "keeps neither first nor last" + +[8908e351-4437-4d2b-a0f7-770811e48816] +description = "keeps strings" + +[2728036b-102a-4f1e-a3ef-eac6160d876a] +description = "keeps lists" + +[ef16beb9-8d84-451a-996a-14e80607fce6] +description = "discard on empty list returns empty list" + +[2f42f9bc-8e06-4afe-a222-051b5d8cd12a] +description = "discards everything" + +[ca990fdd-08c2-4f95-aa50-e0f5e1d6802b] +description = "discards nothing" + +[71595dae-d283-48ca-a52b-45fa96819d2f] +description = "discards first and last" + +[ae141f79-f86d-4567-b407-919eaca0f3dd] +description = "discards neither first nor last" + +[daf25b36-a59f-4f29-bcfe-302eb4e43609] +description = "discards strings" + +[a38d03f9-95ad-4459-80d1-48e937e4acaf] +description = "discards lists" diff --git a/exercises/practice/strain/strain.spec.js b/exercises/practice/strain/strain.spec.js index 0ba712458f..919bd7d169 100644 --- a/exercises/practice/strain/strain.spec.js +++ b/exercises/practice/strain/strain.spec.js @@ -10,6 +10,10 @@ describe('strain', () => { expect(keep([1, 2, 3], (e) => e < 10)).toEqual([1, 2, 3]); }); + xtest('keeps nothing', () => { + expect(keep([1, 2, 3], (e) => e > 10)).toEqual([]); + }); + xtest('keeps first and last', () => { expect(keep([1, 2, 3], (e) => e % 2 === 1)).toEqual([1, 3]); }); @@ -24,7 +28,7 @@ describe('strain', () => { expect(result).toEqual('zebra zombies zelot'.split(' ')); }); - xtest('keeps arrays', () => { + xtest('keeps lists', () => { const rows = [ [1, 2, 3], [5, 5, 5], @@ -43,10 +47,14 @@ describe('strain', () => { ]); }); - xtest('empty discard', () => { + xtest('discards everything', () => { expect(discard([], (e) => e < 10)).toEqual([]); }); + xtest('discards everything', () => { + expect(discard([1, 3, 5], (e) => e < 10)).toEqual([]); + }); + xtest('discards nothing', () => { expect(discard([1, 2, 3], (e) => e > 10)).toEqual([1, 2, 3]); }); @@ -66,7 +74,7 @@ describe('strain', () => { expect(result).toEqual('apple banana cherimoya'.split(' ')); }); - xtest('discards arrays', () => { + xtest('discards lists', () => { const rows = [ [1, 2, 3], [5, 5, 5],