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

Improvements to JS1 week1 homework - #13

Merged
illicitonion merged 1 commit into
CodeYourFuture:masterfrom
illicitonion:week1
Jun 20, 2020
Merged

illicitonion merged 1 commit into
CodeYourFuture:masterfrom
illicitonion:week1

Conversation

@illicitonion

Copy link
Copy Markdown
Member
  • Tests show what was expected and what was actually returned. This both
    helps the students to understand what was wrong, and is more like what
    they'll encounter in real life from test suites.
  • Fix up partial rename from getRemainder to getTotal.
  • Fix up real-world logic of currency conversion (a % fee should cost
    you more, not give you more!)
  • Magic 8 ball doesn't use a global variable, and explains slightly more
    what checkAnswer should actually do.
  • Magic 8 ball tests to make sure more than one value is actually
    returned.

Note that this introduces use of require to import util - this is a
built-in module in Node, so doesn't add any extra requirements to how
the tests are run, but does introduce an element of syntax we haven't
taught the students. This is only in the test machinery itself, and is
fairly cosmetic, so hopefully won't confuse folks.

* Tests show what was expected and what was actually returned. This both
  helps the students to understand what was wrong, and is more like what
  they'll encounter in real life from test suites.
* Fix up partial rename from getRemainder to getTotal.
* Fix up real-world logic of currency conversion (a % fee should _cost_
  you more, not _give_ you more!)
* Magic 8 ball doesn't use a global variable, and explains slightly more
  what checkAnswer should actually do.
* Magic 8 ball tests to make sure more than one value is actually
 returned.

Note that this introduces use of `require` to import `util` - this is a
built-in module in Node, so doesn't add any extra requirements to how
the tests are run, but does introduce an element of syntax we haven't
taught the students. This is only in the test machinery itself, and is
fairly cosmetic, so hopefully won't confuse folks.
@illicitonion
illicitonion merged commit 1ffdd46 into CodeYourFuture:master Jun 20, 2020
@illicitonion
illicitonion deleted the week1 branch June 20, 2020 21:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants