|
1 | | -const getAngleType = require("./1-get-angle-type"); |
| 1 | +const getAngleType = require("./1-get-angle-type"); // Import the function to be tested |
2 | 2 |
|
3 | 3 | test("should identify right angle (90°)", () => { |
4 | 4 | expect(getAngleType(90)).toEqual("Right angle"); |
5 | 5 | }); |
6 | 6 |
|
7 | | -// REPLACE the comments with the tests |
8 | | -// make your test descriptions as clear and readable as possible |
9 | | - |
10 | 7 | // Case 2: Identify Acute Angles: |
11 | 8 | // When the angle is less than 90 degrees, |
12 | 9 | // Then the function should return "Acute angle" |
13 | 10 |
|
| 11 | +test("should identify Acute Angles (< 90)", () => { |
| 12 | + expect(getAngleType(45)).toEqual("Acute Angle"); |
| 13 | +}); |
14 | 14 | // Case 3: Identify Obtuse Angles: |
15 | 15 | // When the angle is greater than 90 degrees and less than 180 degrees, |
16 | 16 | // Then the function should return "Obtuse angle" |
17 | | - |
| 17 | +test("should identify Obtuse angle (>90 && <180)", () => { |
| 18 | + expect(getAngleType(120)).toEqual("Obtuse angle"); |
| 19 | +}); |
18 | 20 | // Case 4: Identify Straight Angles: |
19 | 21 | // When the angle is exactly 180 degrees, |
20 | 22 | // Then the function should return "Straight angle" |
21 | | - |
| 23 | +test("should identify Straight Angle (180°)", () => { |
| 24 | + expect(getAngleType(180)).toEqual("Straight angle"); |
| 25 | +}); |
22 | 26 | // Case 5: Identify Reflex Angles: |
23 | 27 | // When the angle is greater than 180 degrees and less than 360 degrees, |
24 | 28 | // Then the function should return "Reflex angle" |
| 29 | +test("should identify Straight Angle (> 180 && < 360)", () => { |
| 30 | + expect(getAngleType(278)).toEqual("Reflex angle"); |
| 31 | +}); |
0 commit comments