Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(413)

Unified Diff: Tools/GardeningServer/README-mocha

Issue 411763003: Set up mocha, chai and karma for sheriff-o-matic unit testing. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rm head/body tag Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Tools/GardeningServer/.gitignore ('k') | Tools/GardeningServer/bower.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Tools/GardeningServer/README-mocha
diff --git a/Tools/GardeningServer/README-mocha b/Tools/GardeningServer/README-mocha
new file mode 100644
index 0000000000000000000000000000000000000000..e558bd05287ab0d2d2e93477644305965a77df15
--- /dev/null
+++ b/Tools/GardeningServer/README-mocha
@@ -0,0 +1,39 @@
+sheriff-o-matic must be run from a server in order to handle Polymer imports correctly.
+
+1. cd Tools
+2. python -m SimpleHTTPServer
+3. Load http://localhost:8000/GardeningServer/sheriff-o-matic.html
+
+Dependencies, including Polymer and mocha, must be synced via bower in order for anything to work.
+
+INSTALLING NPM/BOWER
+The version of npm in apt-get is too old for bower. Instead
+install it from http://nodejs.org/download/.
+
+Install bower with:
+ sudo npm install -g bower
+
+SYNCING DEPENDENCIES
+1. cd Tools/GardeningServer
+2. bower update
+3. npm install
+
+TESTING
+The tests can be run in the browser or from the command line.
+
+In the browser: http://localhost:8000/GardeningServer/test/run-unit-tests.html.
+
+From the command line:
+1. cd Tools/GardeningServer
+2. ./node_modules/karma/bin/karma start
+
+With 'npm install -g karma-cli', you can just use 'karma start'.
+
+LIBRARIES
+sugar: Provides generic syntactic sugar for JavaScript, mostly by extending native object prototypes.
+
+karma: test runner. Runs the unit tests in an instance of Chrome and pipes the results to the command line. By default, it watches for changes to files and will automatically re-run the tests. To run once and exit, use 'karma start --single-run'.
+
+mocha: testing framework. Provides good asynchronous and synchronous test support. Tests run serially, so exceptions are reported for the right test case.
+
+chai: assertion library. Provides TDD and BDD-style assertions.
« no previous file with comments | « Tools/GardeningServer/.gitignore ('k') | Tools/GardeningServer/bower.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698