GithubHelp home page GithubHelp logo

fswd-lab-1's Introduction

Purpose: To run node and npm on the command line, learn about git and TDD, write JavaScript code, and write tests for that code.

Goal: By the end of the lab, you will have downloaded the initial project from GitHub with the git command, run npm multiple different ways, written JavaScript functions and tests using multiple features of the JavaScript language (var, function, if, else, for, return, arrays, and more), and have at least basic working versions of the FizzBuzz and Fibonacci functions.

Full Stack Web Development - Lab 1

Testing, FizzBuzz, and Fibonacci

These are classic programming interview questions!

We will start by cloning the repository to your own machine.

Huh? Cloning? What's that?

Cloning is the process where the git tool makes a copy of the code from GitHub on your laptop, including the code's history of changes.

How do I do that?

To start with, open the Terminal application on your laptop. Once you have the terminal window open, you will need to change directories/folders to where you will create the copy of the code on your machine.

Where?

I like to set up a special directory on my machine to hold all my programming projects (~/Code, and ~ is short for your home directory, which is where the Terminal usually starts). Run mkdir Code at the prompt (mkdir = "Make directory"). After you have done that, run cd Code to change the working directory of your shell (the starting location for any command you run). You can verify that it has been changed by running the pwd (print working directory) command.

Then, in your browser, while looking at the page for the lab repository, click the green "Clone or download" button on the right side, make sure "Clone with HTTPS" is displayed in the title of the popup (or, click "Use HTTPS" in the upper right if it is not), and click the button to copy the repository url to your clipboard. Back in your terminal window where you changed the working directory, type git and then paste that repository url in and hit the return key.

You should see something similar to this:

$ git clone https://github.com/betamore/fswd-lab-1.git
Cloning into 'fswd-lab-1'...
remote: Counting objects: 136, done.
remote: Compressing objects: 100% (12/12), done.
remote: Total 136 (delta 5), reused 15 (delta 5), pack-reused 118
Receiving objects: 100% (136/136), 52.11 KiB | 1.18 MiB/s, done.
Resolving deltas: 100% (53/53), done.

Note that the url for the git repository is simply <url of github page>.git.

Now what?

The git tool created the fswd-lab-1 directory inside the working directory of your terminal. Use the cd command again to change the working directory to fswd-lab-1 (Hint: cd fswd-lab-1). Once inside the directory, if you installed the nvm tool, run nvm use.

Actually working with the code

  1. Run npm install to install the node modules for the project, then npm test to run the tests.
  2. Everything passes! Grab yourself a cookie; you're all done.
  3. Yeah, I was kidding. You're not done at all!
  4. Open up Visual Studio Code (or your preferred text editor) and look at the files in the code. Tests are in the test/ directory and the function skeletons are in the lib/ directory.
  5. The first cases are implemented and tested (fizzBuzz(0) and fib(0)). Start by writing tests for the next case (1) and expand the function to handle it correctly.
  6. Then 2, then 3, …

fswd-lab-1's People

Contributors

greenkeeper[bot] avatar rayners avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

fswd-lab-1's Issues

An in-range update of eslint is breaking the build 🚨

The devDependency eslint was updated from 5.15.3 to 5.16.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

eslint is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Release Notes for v5.16.0
  • dfef227 Build: gensite passes rulesMeta to formatter rendering (#11567) (Kevin Partington)
  • c06d38c Fix: Allow HTML formatter to handle no meta data (#11566) (Ilya Volodin)
  • 87a5c03 Docs: func-style: clarify when allowArrowFunctions is used (#11548) (Oliver Joseph Ash)
  • bc3e427 Update: pass rule meta to formatters RFC 10 (#11551) (Chris Meyer)
  • b452f27 Chore: Update README to pull in reviewer data (#11506) (Nicholas C. Zakas)
  • afe3d25 Upgrade: Bump js-yaml dependency to fix Denial of Service vulnerability (#11550) (Vernon de Goede)
  • 4fe7eb7 Chore: use nyc instead of istanbul (#11532) (Toru Nagashima)
  • f16af43 Chore: fix formatters/table test (#11534) (Toru Nagashima)
  • 78358a8 Docs: fix duplicate punctuation in CLI docs (#11528) (Teddy Katz)
Commits

The new version differs by 11 commits.

  • ded2f94 5.16.0
  • ea36e13 Build: changelog update for 5.16.0
  • dfef227 Build: gensite passes rulesMeta to formatter rendering (#11567)
  • c06d38c Fix: Allow HTML formatter to handle no meta data (#11566)
  • 87a5c03 Docs: func-style: clarify when allowArrowFunctions is used (#11548)
  • bc3e427 Update: pass rule meta to formatters RFC 10 (#11551)
  • b452f27 Chore: Update README to pull in reviewer data (#11506)
  • afe3d25 Upgrade: Bump js-yaml dependency to fix Denial of Service vulnerability (#11550)
  • 4fe7eb7 Chore: use nyc instead of istanbul (#11532)
  • f16af43 Chore: fix formatters/table test (#11534)
  • 78358a8 Docs: fix duplicate punctuation in CLI docs (#11528)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Version 10 of node.js has been released

Version 10 of Node.js (code name Dubnium) has been released! 🎊

To see what happens to your code in Node.js 10, Greenkeeper has created a branch with the following changes:

  • Replaced the old Node.js version in your .nvmrc with the new one

If you’re interested in upgrading this repo to Node.js 10, you can open a PR with these changes. Please note that this issue is just intended as a friendly reminder and the PR as a possible starting point for getting your code running on Node.js 10.

More information on this issue

Greenkeeper has checked the engines key in any package.json file, the .nvmrc file, and the .travis.yml file, if present.

  • engines was only updated if it defined a single version, not a range.
  • .nvmrc was updated to Node.js 10
  • .travis.yml was only changed if there was a root-level node_js that didn’t already include Node.js 10, such as node or lts/*. In this case, the new version was appended to the list. We didn’t touch job or matrix configurations because these tend to be quite specific and complex, and it’s difficult to infer what the intentions were.

For many simpler .travis.yml configurations, this PR should suffice as-is, but depending on what you’re doing it may require additional work or may not be applicable at all. We’re also aware that you may have good reasons to not update to Node.js 10, which is why this was sent as an issue and not a pull request. Feel free to delete it without comment, I’m a humble robot and won’t feel rejected 🤖


FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.