-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1-get-angle-type.test.js
More file actions
36 lines (32 loc) · 1.4 KB
/
1-get-angle-type.test.js
File metadata and controls
36 lines (32 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// This statement loads the getAngleType function you wrote in the implement directory.
// We will use the same function, but write tests for it using Jest in this file.
const getAngleType = require("../implement/1-get-angle-type");
test("should identify right angle (90°)", () => {
expect(getAngleType(90)).toEqual("Right angle");
});
// REPLACE the comments with the tests
// make your test descriptions as clear and readable as possible
// Case 2: Identify Acute Angles:
// When the angle is less than 90 degrees,
// Then the function should return "Acute angle"
test("should identify Acute Angles", () => {
expect(getAngleType(70)).toEqual("Acute angle");
});
// Case 3: Identify Obtuse Angles:
// When the angle is greater than 90 degrees and less than 180 degrees,
// Then the function should return "Obtuse angle"
test("should identify Obtuse Angles", () => {
expect(getAngleType(120)).toEqual("Obtuse angle");
});
// Case 4: Identify Straight Angles:
// When the angle is exactly 180 degrees,
// Then the function should return "Straight angle"
test("should identify Straight Angles", () => {
expect(getAngleType(180)).toEqual("Straight angle");
});
// Case 5: Identify Reflex Angles:
// When the angle is greater than 180 degrees and less than 360 degrees,
// Then the function should return "Reflex angle"
test("should identify Reflex Angles", () => {
expect(getAngleType(240)).toEqual("Reflex angle");
});