Skip to content

Commit 6649ae9

Browse files
remove test from proper fraction bigint validation and test . Also fixing the get angle jest test description
1 parent eaab882 commit 6649ae9

File tree

4 files changed

+14
-18
lines changed

4 files changed

+14
-18
lines changed

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

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,17 @@
1212

1313
function isProperFraction(numerator, denominator) {
1414
// TODO: Implement this function
15-
if(typeof numerator === "bigint"|| typeof denominator === "bigint"){
15+
16+
if (
17+
numerator >= 0 &&
18+
denominator >= 0 &&
19+
denominator !== 0 &&
20+
numerator < denominator
21+
) {
22+
return true;
23+
} else {
1624
return false;
1725
}
18-
19-
if ( numerator >= 0 && denominator >= 0 && denominator !==0 && numerator < denominator){
20-
return true;
21-
} else {
22-
return false
23-
}
2426
}
2527

2628
// The line below allows us to load the isProperFraction function into tests in other files.
@@ -43,6 +45,6 @@ assertEquals(isProperFraction(1, 2), true);
4345
assertEquals(isProperFraction("2", 2), false);
4446
assertEquals(isProperFraction(3, 4), true);
4547
assertEquals(isProperFraction(5, 10), true);
46-
assertEquals(isProperFraction(- 4, 2), false);
47-
assertEquals(isProperFraction(- 4, 10), false);
48-
assertEquals(isProperFraction(123123213n, 0), false);
48+
assertEquals(isProperFraction(-4, 2), false);
49+
assertEquals(isProperFraction(-4, 10), false);
50+
assertEquals(isProperFraction(123123213n, 0), false);

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
@@ -46,7 +46,6 @@ function getCardValue(card) {
4646
let rank = card.slice(0, -1);
4747
let suit = card.slice(-1);
4848
if (
49-
typeof card !== "string" ||
5049
!cardRanks.includes(rank) ||
5150
!cardSuits.includes(suit)
5251
) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ test(`should return "Reflex angle" when ( 180 < angle < 360)`, () => {
3434
expect(getAngleType(359)).toEqual("Reflex angle");
3535
});
3636
// Case 6: Invalid angles
37-
test(`should return "Invalid angle" when ( 0 < angle or angle > 360)`, () => {
37+
test(`should return "Invalid angle" when 0 <= angle or angle >= 360)`, () => {
3838
expect(getAngleType(-1)).toEqual("Invalid angle");
3939
expect(getAngleType(-10)).toEqual("Invalid angle");
4040
expect(getAngleType(361)).toEqual("Invalid angle");

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

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,7 @@ test(`should return false when numerator value is negative `, () => {
1717
test(`should return false when denominator value is negative`, () => {
1818
expect(isProperFraction(1, -2)).toEqual(false);
1919
});
20-
test(`should return false when denominator is bigInt`, () => {
21-
expect(isProperFraction(1, 23443243n)).toEqual(false);
22-
});
23-
test(`should return false when numerator is infinity`, () => {
24-
expect(isProperFraction(23432434n, 10)).toEqual(false);
25-
});
20+
2621
test(`should return true when denominator is bigger then numerator`, () => {
2722
expect(isProperFraction(5, 10)).toEqual(true);
2823
});

0 commit comments

Comments
 (0)