Chat on irc.freenode.net
in the #jsperf
channel.
You’ll need node.js and MySQL installed.
- Clone the repository (
git clone https://github.com/jsperf/jsperf.com.git
). - Install dependencies (
npm install
). - Get a Browserscope.org API key by signing in and going to the settings page. (You'll need this in the next step)
- Register a new OAuth GitHub development application by going to your settings page in github. Take note to copy the "Client ID" and "Client Secret". The callback URL is simply the root url of the application, e.g., "http://localhost:3000"
- Setup database and other environment configuration (
npm run setup
).
npm start
We use lab as our test utility and code as our assertion library. Lab lints with eslint using the semistandard style. 100% code coverage by unit tests is required. To run the test suite:
# everything
npm test
# directory
npm test -- test/server/web
# file
npm test -- test/server/web/contributors/index.js
If you'd just like to lint and save a little time, you can run npm run lint
which skips the tests.
If you'd like an HTML report with code coverage, you can run npm run test-cov-html
which will create coverage.html
in the root of the project.
- ES6 Template Strings are not supported by esprima which means you can't generate coverage reports which means
npm test
won't pass.
If you'd like extra debugging information when running the server, run with the DEBUG
environment variable set to *
for everything including dependencies or jsperf*
for only this project's debugging statements.
DEBUG=jsperf* npm start
To add more debugging, require the debug
module and namespace according to the path to the file. For example, if you want to add debugging information in server/web/errors
, the debug name would be jsperf:web:errors
. This allows you to finely tune which debug statements you turn on.
To only turn on web
debug statements and not services
:
DEBUG=jsperf:web* npm start