Skip to content

Commit cb53f9a

Browse files
committed
Export complete getAngleType() function for Jest testing
1 parent a6dd884 commit cb53f9a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed
Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
function getAngleType(angle) {
22
if (angle === 90) return "Right angle";
3-
// replace with your completed function from key-implement
4-
3+
if (angle < 90) return "Acute angle";
4+
if (angle > 90 && angle < 180) return "Obtuse angle";
5+
if (angle === 180) return "Straight angle";
6+
if (angle > 180 && angle < 360) return "Reflex angle";
7+
throw new Error("Invalid angle");
58
}
69

710

@@ -11,8 +14,10 @@ function getAngleType(angle) {
1114

1215

1316

17+
1418
// Don't get bogged down in this detail
1519
// Jest uses CommonJS module syntax by default as it's quite old
1620
// We will upgrade our approach to ES6 modules in the next course module, so for now
1721
// we have just written the CommonJS module.exports syntax for you
22+
1823
module.exports = getAngleType;

0 commit comments

Comments
 (0)