Code Monkey home page Code Monkey logo

js-kata-angular's Introduction

JavaScript Kata Template Project

The goal of this project is to get you writing code as quickly as possible.

This is a pretty simple setup to do test first development with JavaScript using the Jasmine test framework and the Testacular test runner.

Sugar.js is included for convenience.

This project is designed to be used with IntelliJ IDEA, though there's no reason that it shouldn't work with other editors as well.

Before starting

  1. Install Node.js

  2. Install Testacular. We'll use this for running tests.

    npm install -g testacular
    
  3. Install Bower. We'll use this for grabbing dependencies.

    npm install -g bower
    

Set up the project

  1. Get the project. The simplest way is to download the project as a zip archive from GitHub. Advanced users are free to perform a git clone. Really advanced users may want to create a fork.

  2. Open the project in your IDE of choice. Everything should be set up already for IntelliJ IDEA users.

  3. Use Bower to grab dependencies. For IntelliJ IDEA users, there is a build config for this. For all others:

    bower install
    
  4. Verify the Bower install operation by checking for a 'components' directory in the project. Inside it should be directories for both 'angular' and 'sugar.' Some users have reported needing to run Bower twice the first time they use it.

To start testing

One you start the Testacular runner, it should watch for changes and continuously run appropriate tests.

  • For IntelliJ IDEA users, run the "Testacular Start" run configuration.

  • Alternately, run:

     testacular start
    

Troubleshooting

  1. I'm getting weird errors when I try to npm install anything. Also, I'm on a *nix platform.

    You may need to invoke the command with sudo. This should not happen on MacOS if you installed Node using Homebrew.

  2. I installed Testacular and Bower via NPM, but it can't find them when I run them.

    If you installed Node via Homebrew on MacOS, the NPM bin directory might not be on the path. Try:

    sudo nano /etc/paths
    

    add /usr/local/share/npm/bin hit ctrl-x, then y to save and exit restart your terminal

  3. I'm getting errors when I try to start Testacular.

    By default, this project is configured to use PhantomJS as the test browser. Either:

    • Install PhantomJS. On MacOS with Homebrew: brew install phantomjs
      • OR - edit testacular.conf.js. Set the "browsers" element to the browser or browsers of your choice.
  4. I tried 'bower install,' but it didn't create a 'components' directory in my project.

    First, sometimes the IDE does not immediately pick up file changes that happen outside of it. Check for the directory outside of the IDE using Finder/Explorer/Terminal/etc.

    Second, some users have reported that their very first 'bower install' doesn't work. Try running it a second time, just in case.

Notes for Posterity

  1. We have configured Bower to grab Angular via the ZIP distribution provided by Google. It would be nice if there were a good Bower repository for it, but, alas, there's a bunch that have different things, they're all out of date and none of them have the testing files. As such, you'll need to update the version manually in the component.json file.

js-kata-angular's People

Contributors

ecowden 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.