etcgroup / text-prizm

3 stars 0 forks source link

Add js unit tests framework #64

Closed michaelbrooks closed 11 years ago

michaelbrooks commented 11 years ago

Added support for unit testing JavaScript using Jasmine.js.

There are two ways to run the tests. First, to run via ant in the terminal, you must install Phantom.js on your machine (http://phantomjs.org/). Then use ant test-client to run the tests.

Second, you can run the tests in your browser for a prettier experience. To do this you have to open tests/client/TestRunner.html in your browser. Unfortunately since our code loads a bunch of resources (modules, templates...) dynamically, you can't just open the file from the file system (Chrome and FF block file:// pages from loading other file:// resources). You can run python -m SimpleHTTPServer in the root text-prizm directory and then open http://localhost:8000/tests/client/TestRunner.html.

I'll be adding info about this to the wiki.

geosoco commented 11 years ago

overall looks good.