Skip to content
This repository was archived by the owner on Oct 26, 2020. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add specific tests for checkAnswer
  • Loading branch information
illicitonion committed Jun 22, 2020
commit 10901fd375a99f2a6609599b4a6b2285214636ac
11 changes: 11 additions & 0 deletions week-1/3-extra/3-magic-8-ball.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,17 @@ function testAll() {
logged === "The ball has shaken!"
);
test(`shakeBall returns an string answer`, typeof answer === "string");

test(
`checkAnswer("It is decidedly so.") returns "very positive`,
checkAnswer("It is decidedly so.") === "very positive"
)

test(
`checkAnswer("My reply is no.") returns "very negative`,
checkAnswer("My reply is no.") === "very negative"
)

test(
`checkAnswer returns the level of positivity"`,
["very positive", "positive", "negative", "very negative"].includes(
Expand Down