Submit a pull request to master with passing tests (npm test) and properly styled code. Rebase as needed.
During development it may be helpful to automatically restart the server when you make changes.
npm run watch
If you make any changes inside client/, then you'll need to manually re-build the final asset.
npm run build
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:
npm test
If you want to only lint and save a little time, use npm run lint which skips the tests.
If you are missing code coverage, open coverage.html in the root of the project for a detailed visual report.
End-to-end testing is done by Selenium Webdriver. SauceLabs provides Selenium infrastructure for CI. To run tests locally, you'll need Chrome and webdriver-manager.
npm i -g webdriver-manager
webdriver-manager update
In one terminal, have jsPerf running (npm start). In another, have webdriver-manager running (webdriver-manager start). And in yet another, run the tests:
SELENIUM_SERVER=http://127.0.0.1:4444/wd/hub npm run test-e2e
Lab detects global variable leaks. Sometimes downstream dependencies make this unavoidable so we ignore specific variables in the lab command for npm test (package.json#scripts.test). Here are the known globals with explanations:
__core-js_shared__stems fromcore-js?__grim__stems fromgrim, a dependency ofmarky-markdown(npm ls grim)
Install using npm and either --save or --save-dev. Do not edit package.json manually.