diff --git a/.gitignore b/.gitignore index ca336a3..8718db7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ /node_modules/ /build/ /.nyc_output/ -/coverage/ diff --git a/api/aois.js b/api/aois.js index 9dfccaa..51c14bc 100644 --- a/api/aois.js +++ b/api/aois.js @@ -44,9 +44,9 @@ function get(id, options) { * @param {function(function())} options.terminator A function that is called * with a function that can be called back to terminate the request. * @return {Promise.} A promise that resolves to an array of AOI - * metadata or is rejected with any error. See the [`errors` module] - * (#module:planet-client/api/errors) for a list of the possible error - * types. + * metadata or is rejected with any error. See the [`errors` + * module](#module:planet-client/api/errors) for a list of the possible + * error types. * @see {@link get} to obtain an individual AOI's GeoJSON and metadata. */ function list(id, options) { @@ -70,9 +70,9 @@ function list(id, options) { * @param {function(function())} options.terminator A function that is called * with a function that can be called back to terminate the request. * @return {Promise.} A promise that resolves to an array of AOI - * metadata or is rejected with any error. See the [`errors` module] - * (#module:planet-client/api/errors) for a list of the possible error - * types. + * metadata or is rejected with any error. See the [`errors` + * module](#module:planet-client/api/errors) for a list of the possible + * error types. */ function create(name, file, options) { options = options || {}; diff --git a/package.json b/package.json index 3753e2f..1683ac8 100644 --- a/package.json +++ b/package.json @@ -14,11 +14,11 @@ "scripts": { "pretest": "eslint bin examples api cli test", "test-node": "nyc mocha --recursive test", - "test-browser": "karma start test/karma.config.js --single-run", - "test": "npm run test-node && npm run test-browser", - "coverage": "nyc report --reporter=html", - "test-debug": "mocha --debug-brk --recursive test", - "start": "watchy --watch bin,examples,api,cli,test -- npm test", + "test-browser-once": "karma start test/karma.config.js --single-run", + "test-browser-forever": "karma start test/karma.config.js", + "test": "npm run test-node && npm run test-browser-once", + "start": "npm run test-browser-forever & watchy --watch bin,examples,api,cli,test -- bash -c '(npm run pretest && npm run test-node)'", + "coverage": "nyc report --reporter=text-lcov | coveralls", "postpublish": "npm run publish-doc", "apidoc": "mkdir -p build && jsdoc --template jsdoc-json --destination build/api.json api", "doc": "npm run apidoc && node --harmony-generators tasks/build-docs.js", diff --git a/readme.md b/readme.md index 67bcc53..975c4ed 100644 --- a/readme.md +++ b/readme.md @@ -48,19 +48,33 @@ To get set up, clone the repository and install the development dependencies: cd planet-client-js npm install -Run the tests to ensure any changes meet the coding style and maintain the expected functionality: +#### Running the tests + +The tests are run in a browser and in Node. You can run the linter and all tests once with the following: npm test -During development, you can start a file watcher that runs the linter and tests with any file changes: +To start a file watcher that runs the linter and tests with any file changes: npm start +With the `npm start` task running, you can attach any number of browsers to the [test server](http://localhost:9876/). Every time you attach a new browser, tests run in all browsers. To debug any failing test, visit the test runner [debug page](http://localhost:9876/debug.html) and open your development console. + +#### Building the docs + +The project docs are generated from templates in the `doc` directory. The API docs are generated based on annotations in comments throughout the `api` modules. You can build the docs with the following task: + + npm run doc + +If you are making frequent changes and want to rebuild the docs with each change, use the `npm run start-doc` task. You can view the doc output in the `build/doc` directory. + +#### Publishing a release + Releases are published from the master branch. To cut a new minor release, do this: npm version minor && git push --tags origin master && npm publish -The `postpublish` script will update [the docs](http://planetlabs.github.io/planet-client-js/). +The `postpublish` script will update the hosted version of [the docs](http://planetlabs.github.io/planet-client-js/). [![Build Status][travis-image]][travis-url] [![Coverage Status][coveralls-image]][coveralls-url]