Skip to content

Commit 295dece

Browse files
committed
implementing and rewriting tests
1 parent e577f7f commit 295dece

File tree

6 files changed

+0
-8
lines changed

6 files changed

+0
-8
lines changed

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ function getAngleType(angle) {
2323
else if (180 < angle && angle < 360) return "Reflex angle";
2424
else return "Invalid angle";
2525
}
26-
2726
// The line below allows us to load the getAngleType function into tests in other files.
2827
// This will be useful in the "rewrite tests with jest" step.
2928
module.exports = getAngleType;

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ function isProperFraction(numerator, denominator) {
1515
if (Math.abs(numerator) < Math.abs(denominator)) return true;
1616
else return false;
1717
}
18-
1918
// The line below allows us to load the isProperFraction function into tests in other files.
2019
// This will be useful in the "rewrite tests with jest" step.
2120
module.exports = isProperFraction;

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
// Acceptance criteria:
2121
// After you have implemented the function, write tests to cover all the cases, and
2222
// execute the code to ensure all tests pass.
23-
2423
function getCardValue(card) {
2524
// TODO: Implement this function
2625
if (typeof card !== "string") {

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ test(`should return "Acute angles" when (0 < angle < 90)`, () => {
1212
expect(getAngleType(45)).toBe("Acute angle");
1313
expect(getAngleType(89)).toBe("Acute angle");
1414
});
15-
1615
// Case 2: Right angle
1716
test(`should return "Right angle" when (angle === 90)`, () => {
1817
// Test various acute angles, including boundary cases

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
const isProperFraction = require("../implement/2-is-proper-fraction");
44

55
// TODO: Write tests in Jest syntax to cover all combinations of positives, negatives, zeros, and other categories.
6-
76
// Special case: numerator is zero
87
test(`should return false when denominator is zero`, () => {
98
expect(isProperFraction(1, 0)).toEqual(false);

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,19 @@ test(`Should return the numeric value for number cards`, () => {
1515
expect(getCardValue("9♦")).toEqual(9);
1616
expect(getCardValue("10♣")).toEqual(10);
1717
});
18-
1918
// Case 3: Face Cards (J, Q, K)
2019
test(`Should return 10 for face cards`, () => {
2120
expect(getCardValue("J♠")).toEqual(10);
2221
expect(getCardValue("Q♥")).toEqual(10);
2322
expect(getCardValue("K♦")).toEqual(10);
2423
});
25-
2624
// Case 4: Invalid Cards
2725
test(`Should throw "Invalid card" for invalid cards`, () => {
2826
expect(() => getCardValue("1♠")).toThrow("Invalid card");
2927
expect(() => getCardValue("B♠")).toThrow("Invalid card");
3028
expect(() => getCardValue("A$")).toThrow("Invalid card");
3129
expect(() => getCardValue("10X")).toThrow("Invalid card");
3230
});
33-
3431
// Suggestion: Group the remaining test data into these categories:
3532
// Number Cards (2-10)
3633
// Face Cards (J, Q, K)

0 commit comments

Comments
 (0)