docs(CONTRIBUTING): update contributing.md (#1973)

This commit is contained in:
Andrey Lushnikov 2018-02-08 00:59:11 -05:00 committed by GitHub
parent ac1b9a0eb0
commit 070243e4b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -45,6 +45,15 @@ To run code linter, use:
npm run lint npm run lint
``` ```
## API guidelines
When authoring new API methods, consider the following:
- expose as little information as needed. When in doubt, dont expose new information
- methods are used in favor of getters/setters
- the only exception is namespaces, e.g. `page.keyboard` and `page.coverage`
- all string literals must be small case. This includes event names and option values
- avoid adding "sugar" API (API that is trivially implementable in user-space) unless they're **very** demanded
## Commit Messages ## Commit Messages
Commit messages should follow the Semantic Commit Messages format: Commit messages should follow the Semantic Commit Messages format:
@ -118,9 +127,9 @@ Despite being named 'unit', these are integration tests, making sure public API
``` ```
npm run unit npm run unit
``` ```
- To filter tests by name: - To run tests in parallel, use `-j` flag:
``` ```
npm run unit -- --filter=waitFor npm run unit -- -j 4
``` ```
- To run a specific test, substitute the `it` with `fit` (mnemonic rule: '*focus it*'): - To run a specific test, substitute the `it` with `fit` (mnemonic rule: '*focus it*'):
```js ```js
@ -154,7 +163,7 @@ HEADLESS=false SLOW_MO=500 npm run unit
``` ```
- To debug a test, "focus" a test first and then run: - To debug a test, "focus" a test first and then run:
``` ```
npm run debug-unit node --inspect-brk test/test.js
``` ```
## Public API Coverage ## Public API Coverage