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

Side by Side 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, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Tools/GardeningServer/.gitignore ('k') | Tools/GardeningServer/bower.json » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 sheriff-o-matic must be run from a server in order to handle Polymer imports cor rectly.
2
3 1. cd Tools
4 2. python -m SimpleHTTPServer
5 3. Load http://localhost:8000/GardeningServer/sheriff-o-matic.html
6
7 Dependencies, including Polymer and mocha, must be synced via bower in order for anything to work.
8
9 INSTALLING NPM/BOWER
10 The version of npm in apt-get is too old for bower. Instead
11 install it from http://nodejs.org/download/.
12
13 Install bower with:
14 sudo npm install -g bower
15
16 SYNCING DEPENDENCIES
17 1. cd Tools/GardeningServer
18 2. bower update
19 3. npm install
20
21 TESTING
22 The tests can be run in the browser or from the command line.
23
24 In the browser: http://localhost:8000/GardeningServer/test/run-unit-tests.html.
25
26 From the command line:
27 1. cd Tools/GardeningServer
28 2. ./node_modules/karma/bin/karma start
29
30 With 'npm install -g karma-cli', you can just use 'karma start'.
31
32 LIBRARIES
33 sugar: Provides generic syntactic sugar for JavaScript, mostly by extending nati ve object prototypes.
34
35 karma: test runner. Runs the unit tests in an instance of Chrome and pipes the r esults 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'.
36
37 mocha: testing framework. Provides good asynchronous and synchronous test suppor t. Tests run serially, so exceptions are reported for the right test case.
38
39 chai: assertion library. Provides TDD and BDD-style assertions.
OLDNEW
« 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