From d8ca8e73416014d52a886874bfa933840d7023e9 Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Sun, 6 Jul 2014 11:53:34 -0600 Subject: [PATCH] Update test readme --- test/README.md | 38 ++++++++++++++++---------------------- 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/test/README.md b/test/README.md index e8d91df92e..d41a58914e 100644 --- a/test/README.md +++ b/test/README.md @@ -1,41 +1,35 @@ -Included in this directory --------------------------- +## Included in this directory -- ol.html - the web page used to run the test suite. +- index.html - the web page used to run the test suite. - spec - includes the OpenLayers test/spec files. - expect-0.2.0 - Minimalistic BDD-style assertion framework. https://github.com/LearnBoost/expect.js/ -- jquery-1.9.1 - The Write Less, Do More, JavaScript Library. - http://jquery.com/ - -- mocha-1.8.1 - the fun, simple, flexible JavaScript test framework. - http://visionmedia.github.com/mocha/ - -- sinon-1.6.0 - Standalone test spies, stubs and mocks for JavaScript. - http://sinonjs.org/ - - test-extensions.js - includes OpenLayers-specific extensions to the testing frameworks. -- mocha-phantom - a PhantomJS script for headless testing with mocha. - http://metaskills.net/mocha-phantomjs/ -Run the test suite with PhantomJS ---------------------------------- +## Run the test suite -With PhantomJS installed, and assuming phantomjs is in the PATH: +Install the test dependencies (from the root of the repository): - $ phantomjs mocha-phantom.coffee ol.html + npm install -(Works with PhantomJS 1.6.1, untested with other versions.) +Run the tests once with PhantomJS: -This command can also be run by doing `./build.py test` at the root of ol3. + npm test -Make sure that the polvr web server is running (`./build.py serve`), otherwise -you will most likely see something like `0 specs, 0 failures in 0.001s.`. +(This can also be run as `./build.py test`.) + +Run the tests in a browser: + + npm start + +Now visit http://localhost:3000/test/ in your browser. (This can also be run +as `./build.py serve`.) The tests will re-run any time one of the source or +spec files changes. Tip for TDD'ers: to make PhantomJS run the test suite continuously each time a spec file is changed you can use nosier (http://pypi.python.org/pypi/nosier)