Git Product home page Git Product logo

fullstacktestfirst's Introduction

##TestFirst JavaScript Overview

Assignment

To get a great overview of what TestFirst learning and development is watch the following video about TestFirst.

For an introduction to Test-Driven Development, read the first three sections of The Newbie's Guide to Test-Driven Development ("What is Test-Driven Development?", "How does it work?", and "Great, but how is this better than regular testing?")

Let's warm up by learning to read tests and write code to match a test's expectations. Read more about the philosophy of Test-First Learning at TestFirst.org.

Setup

To start, we need to fork the repository and install testem, a Node test-runner that will run your test and code.

  1. Fork the repository to your account.
  2. Go to your own repositories on GitHub and clone the FullstackTestFirst repository link.
  3. Use the link in the git clone then follow the rest of the commands.
$ git clone https:github.com/your-github-username/FullstackTestFirst.git
$ cd FullstackTestFirst
$ brew install node
$ sudo npm install -g testem

To run the specs for a directory, you need to go into that directory and run the command testem.

$ cd 00_hello
$ testem
TEST'EM 'SCRIPTS!
Open the URL below in a browser to connect.
http://localhost:7357/

Now, if you open http://localhost:7357 in a browser (we recommend Chrome) you should see the Jasmine Spec runner. The Testem is booting up a small web server, which loads in all the JS files in that directory and brings in Jasmine. Remember, Jasmine is just JavaScript, so it all runs inside the browser.

To add your script (the code you need to write), create a file with the same name as the spec file but without the word spec. For example, to create the functions that helloSpec.js needs to pass the test, create a hello.js file. This works because Jasmine loads all the files in lexigraphical (alphabetical) order, so hello.jscomes before helloSpec.js.

Debugging Methods

The key skill here to practice is debugging JavaScript inside Chrome. You should become comfortable with these methods:

  1. Using the console via console.log and debugger
  2. Stepping through your JS in the Console and evaluating variables

This is a great blog post on the topic:

http://www.creativebloq.com/javascript/javascript-debugging-beginners-3122820 Permalink

###Before beginning your assignment, make sure you have completed these steps:

  1. Forked & cloned the TestFirst repository.
  2. Installed Node and Testem.

fullstacktestfirst's People

Contributors

mingusone avatar scottdalessandro avatar davidyang avatar

Watchers

James Cloos avatar  avatar

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.