Skip to content

Commit 6fe6458

Browse files
committed
created testcases for get angle-type and tested to pass
1 parent f6e6f38 commit 6fe6458

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,34 @@ test("should identify right angle (90°)", () => {
1212
// Case 2: Identify Acute Angles:
1313
// When the angle is less than 90 degrees,
1414
// Then the function should return "Acute angle"
15+
test("should identify acute angle (<90°)", () => {
16+
expect(getAngleType(45)).toEqual("Acute angle");
17+
});
1518

1619
// Case 3: Identify Obtuse Angles:
1720
// When the angle is greater than 90 degrees and less than 180 degrees,
1821
// Then the function should return "Obtuse angle"
22+
test("should identify obtuse angle (>90° and <180°)", () => {
23+
expect(getAngleType(120)).toEqual("Obtuse angle");
24+
});
1925

2026
// Case 4: Identify Straight Angles:
2127
// When the angle is exactly 180 degrees,
2228
// Then the function should return "Straight angle"
29+
test("should identify straight angle (180°)", () => {
30+
expect(getAngleType(180)).toEqual("Straight angle");
31+
});
2332

2433
// Case 5: Identify Reflex Angles:
2534
// When the angle is greater than 180 degrees and less than 360 degrees,
2635
// Then the function should return "Reflex angle"
36+
test("should identify reflex angle (>180° and <360°)", () => {
37+
expect(getAngleType(270)).toEqual("Reflex angle");
38+
});
39+
40+
41+
// We can run this test file using the command `npx jest 1-get-angle-type.test.js`
42+
// in the terminal. Making sure we are in the directory where this file is located.
43+
// If we have Jest installed globally, you can simply run `jest 1-get-angle-type.test.js`
44+
// instead. If you have added a test script to your package.json file, you can also run
45+
// `npm test 1-get-angle-type.test.js` to execute the tests.

0 commit comments

Comments
 (0)