Skip to content
This repository was archived by the owner on Oct 26, 2020. It is now read-only.

Commit 10901fd

Browse files
committed
Add specific tests for checkAnswer
1 parent 1630298 commit 10901fd

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

week-1/3-extra/3-magic-8-ball.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,17 @@ function testAll() {
9090
logged === "The ball has shaken!"
9191
);
9292
test(`shakeBall returns an string answer`, typeof answer === "string");
93+
94+
test(
95+
`checkAnswer("It is decidedly so.") returns "very positive`,
96+
checkAnswer("It is decidedly so.") === "very positive"
97+
)
98+
99+
test(
100+
`checkAnswer("My reply is no.") returns "very negative`,
101+
checkAnswer("My reply is no.") === "very negative"
102+
)
103+
93104
test(
94105
`checkAnswer returns the level of positivity"`,
95106
["very positive", "positive", "negative", "very negative"].includes(

0 commit comments

Comments
 (0)