These are chat archives for
Sign in to start talking
Main discussion room for CodeHub / JS101
Nov 18 2016 00:09
I think the styles are a bit ugly!
Nov 18 2016 01:23
Where are the tests!? :disappointed_relieved:
Nov 18 2016 01:28
in which branch? I haven't disappeared any tests..
Nov 18 2016 07:43
I can’t see any tests for the new components. Perhaps next session we should write them?
Nov 18 2016 07:47
ahh I think I might have written only one 🤔 I was naughty
Nov 18 2016 07:54
yes would be good writing them next time
Nov 18 2016 08:41
You’re not the only naughty one! I think we may have to introduce the naughty step to JS101.
Nov 18 2016 09:44
Yes, I would like to shoulder-surf some tests being written, attempted to learn the fundamentals yesterday... but keep getting lost in dependency injections and async. Going to go again today, and see if I can get it into my noggin.
Nov 18 2016 09:52
Try writing a simple test for a function that adds two numbers
Specify what you expect the result should be and then check to see if it equals the acutal result
returned from the function
Nov 18 2016 11:16
yeah, basic tests like that I understand
going to see if i can implement them in one of my basic projects and see what happens
Nov 18 2016 11:40
Write a test
Watch it fail
Make the test pass in a basic way
Then refactor the code
Are you doing vanilla js or React?
One great aspect of BDD is that it helps you write better code. Single Responsibility Principle, Dependency Injection etc
Think of the different edge cases you can test for eg -1, 0, 1 etc
Or you could start writing a test a component in the JS101 App