Full Stack Web Development - Lab 1: Testing, FizzBuzz, and Fibonacci
Classic programming interview questions!
-
Fork the repository to your own Github account
- Don't have a Github account? Go get one and then come back!
-
Clone the repository to your own machine
Huh? What does that even mean? Short version: you need to create a copy of the code on your machine, and "cloning" is git's way of doing that.
But where? Well, I like to set up a special directory on my machine to hold all my programming projects (
~/Code
). Just open up a terminal window and runmkdir Code
on the prompt (mkdir
= "Make directory"). After you have done that, runcd Code
to change to that directory and then run the git clone command. -
After cloning, run
cd fswd-lab-1
to change your shell's working directory to your copy of the project. -
Run
npm install
to install the node modules for the project, thennpm test
to run the tests. -
Everything passes! Grab yourself a cookie; you're all done.
-
Yeah, I was kidding. You're not done at all!
-
Look at the files in the code. Tests are in
tests/
and the function skeletons are inlib/
. -
The first cases are implemented and tested (
fizzBuzz(0)
andfib(0)
). Start by writing tests for the next case (1) and expand the function to handle it correctly. -
Then 2, then 3, …