README updates

This commit is contained in:
lilia 2014-10-30 14:41:29 -07:00
parent ca7ba43b13
commit e02098eefb
1 changed files with 20 additions and 19 deletions

View File

@ -33,38 +33,39 @@ node, npm, and bower to change them.
### Adding a bower component
Add the package to bower.json under 'dependencies' or
`bower install *package-name* --save`
Add the package name and version to bower.json under 'dependencies' or `bower
install package-name --save`
Next update the "preen" config in bower.json with the list of files we will
actually use from the new package, e.g.:
```
"preen": {
"new-package": ["path/to/main.js", "directory/**/*.js"],
"package-name": [
"path/to/main.js",
"directory/**/*.js"
],
...
}
```
Now, run `grunt` to delete unused package files and concatenate the
remaining javascript files into `js-deps/bower_components.js`. Note that
packages will be concatenated **in order** as specified in the preen
config.
Now, run `grunt` to delete unused package files and concatenate the remaining
javascript files into `js-deps/bower_components.js`. Note that packages will be
concatenated **in the order** that they are listed in the preen config.
Finally, stage and commit changes to bower.json, js-deps/bower_components.js,
and bower_components/. The latter should be limited to files we actually use.
Tests
=====
Please write tests! Our testing framework is mocha and our assertion library is
chai:
Please write tests! Our testing framework is
[mocha](http://visionmedia.github.io/mocha/) and our assertion library is
[chai](http://chaijs.com/api/assert/).
* http://visionmedia.github.io/mocha/
* http://chaijs.com/api/assert/
To run tests, open `test/index.html` in your browser. Note that
Tips/Tricks
===========
* Loading the `test.html` page may read, write or clear localStorage. To avoid
having to choose between running tests and preserving your existing messages,
keys, and other extension data, much of the test suite can be run by starting
a local webserver in the repository root, e.g. `python -m SimpleHTTPServer`.
You can then access the test page at `http://0.0.0.0:8000/test.html`.
* Some tests depend on the native client module. These will fail unless you
load the test page from the `chrome-extension://` namespace (as opposed to
the `file://` namespace or via a local webserver.
* Some tests may read, write or clear localStorage. It is recommended that you
create a Chrome user profile just for running tests to avoid clobbering any
existing account and message data.