Skip to content

Instantly share code, notes, and snippets.

@cciollaro
Created December 7, 2013 20:29

Revisions

  1. cciollaro created this gist Dec 7, 2013.
    12 changes: 12 additions & 0 deletions test-guide
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    let's imagine you wanted to test Coin.js

    1.) create test/coinTest.js
    2.) write tests like these: http://pivotal.github.io/jasmine/. Jasmine is a really great library, go check out that page! :)
    3.) when you've written your test, go to SpecRunner.html and include your test and dependencies like so:
    <!-- include source files here... -->
    <script type="text/javascript" src="js/Coin.js"></script>

    <!-- include spec files here... -->
    <script type="text/javascript" src="test/coinTest.js"></script>
    4.) open up SpecRunner.html in your browser
    5.) get tests passing :)