Skip to content

Commit

Permalink
docs(CONTRIBUTING): update contributing.md (puppeteer#1973)
Browse files Browse the repository at this point in the history
  • Loading branch information
aslushnikov authored Feb 8, 2018
1 parent ac1b9a0 commit 070243e
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@ To run code linter, use:
npm run lint
```

## API guidelines

When authoring new API methods, consider the following:
- expose as little information as needed. When in doubt, don’t 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 should follow the Semantic Commit Messages format:
Expand Down Expand Up @@ -118,9 +127,9 @@ Despite being named 'unit', these are integration tests, making sure public API
```
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*'):
```js
Expand Down Expand Up @@ -154,7 +163,7 @@ HEADLESS=false SLOW_MO=500 npm run unit
```
- To debug a test, "focus" a test first and then run:
```
npm run debug-unit
node --inspect-brk test/test.js
```

## Public API Coverage
Expand Down

0 comments on commit 070243e

Please sign in to comment.