Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code Checkpoint/Example at the "Watch It Fail" Section #100

Open
nelsonic opened this issue Jul 30, 2017 · 1 comment
Open

Code Checkpoint/Example at the "Watch It Fail" Section #100

nelsonic opened this issue Jul 30, 2017 · 1 comment

Comments

@nelsonic
Copy link
Member

nelsonic commented Jul 30, 2017

I was just sitting with someone totally new to JS TDD doing this tutorial and they felt the instructions were unclear just before the first "Watch it Fail" stage:
https://github.com/dwyl/learn-tdd/tree/bcbdc58a41faec5480fb5cbec96a0ca587a3c2e9#watch-it-fail

This could be enhanced by showing people a full index.html as a "Check Point"
so people know where the function and test "goes" in the file.
e.g:

<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Vending Machine Change Calculator TDD</title>
    <link rel="stylesheet" href="https://code.jquery.com/qunit/qunit-1.18.0.css">
    <link rel="stylesheet" href="http://yui.yahooapis.com/pure/0.6.0/pure-min.css">
  </head>
  <body>
    <div id='main' style='padding: 2em;'>
      <h1>Vending Machine Change Calculator</h1>
      <h2>Calculate the Change for a Given Price and Cash Received</h2>
    </div>

    <div id="qunit"></div>
    <div id="qunit-fixture"></div>
    <script src="https://code.jquery.com/qunit/qunit-1.18.0.js"></script>

    <script>
    // your solution will go here!
    </script>

    <script>
    test('getChange(1,1) should equal [] - an empty array', function(assert) {
      var result = getChange(1, 1); //no change/coins just an empty array
      var expected = [];
      assert.deepEqual(result, expected);
    }); // use deepEqual for arrays see: https://api.qunitjs.com/deepEqual/

    </script>
  </body>
</html>
@ghost
Copy link

ghost commented Jul 30, 2017

@nelsonic I agree. that would clarify it for beginners. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant