Skip to content

Commit a17c844

Browse files
Keep only Sprint-3 practice TDD files
1 parent 3372770 commit a17c844

23 files changed

+111
-473
lines changed

Sprint-3/1-implement-and-rewrite-tests/README.md

Lines changed: 0 additions & 47 deletions
This file was deleted.

Sprint-3/1-implement-and-rewrite-tests/implement/1-get-angle-type.js

Lines changed: 0 additions & 37 deletions
This file was deleted.

Sprint-3/1-implement-and-rewrite-tests/implement/2-is-proper-fraction.js

Lines changed: 0 additions & 33 deletions
This file was deleted.

Sprint-3/1-implement-and-rewrite-tests/implement/3-get-card-value.js

Lines changed: 0 additions & 52 deletions
This file was deleted.

Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/1-get-angle-type.test.js

Lines changed: 0 additions & 20 deletions
This file was deleted.

Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/2-is-proper-fraction.test.js

Lines changed: 0 additions & 10 deletions
This file was deleted.

Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/3-get-card-value.test.js

Lines changed: 0 additions & 20 deletions
This file was deleted.

Sprint-3/1-implement-and-rewrite-tests/testing-guide.md

Lines changed: 0 additions & 92 deletions
This file was deleted.

Sprint-3/2-practice-tdd/count.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1-
function countChar(stringOfCharacters, findCharacter) {
2-
return 5
1+
function countChar(str, char) {
2+
let count = 0;
3+
for (let i = 0; i < str.length; i++)
4+
if(str[i] === char)
5+
{
6+
count++;
7+
}
8+
return count;
39
}
410

11+
512
module.exports = countChar;

Sprint-3/2-practice-tdd/count.test.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ test("should count multiple occurrences of a character", () => {
1616
const count = countChar(str, char);
1717
expect(count).toEqual(5);
1818
});
19+
test("should count no occurrences of a character",()=>{
20+
const str = "hello";
21+
const char = "a";
22+
const count = countChar(str, char);
23+
expect(count).toEqual(0);
24+
});
1925

2026
// Scenario: No Occurrences
2127
// Given the input string `str`,

0 commit comments

Comments
 (0)