Skip to content

Commit

Permalink
docs: add options and examples (#438)
Browse files Browse the repository at this point in the history
  • Loading branch information
stoffeastrom committed Mar 12, 2019
1 parent c7d5b4a commit 03d3d25
Show file tree
Hide file tree
Showing 36 changed files with 2,114 additions and 859 deletions.
17 changes: 6 additions & 11 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
},
"globals": {
"sinon": true,
"expect": true
"expect": true,
"aw": true,
"page": true
},
"parserOptions": {
"ecmaFeatures": {
Expand All @@ -25,18 +27,13 @@
"react/jsx-filename-extension": [
1,
{
"extensions": [
".js",
".jsx"
]
"extensions": [".js", ".jsx"]
}
],
"react/prop-types": [
1,
{
"ignore": [
"children"
]
"ignore": ["children"]
}
],
"react/prefer-stateless-function": 0,
Expand All @@ -56,7 +53,5 @@
"no-new": 0,
"import/no-unresolved": 0
},
"extends": [
"airbnb"
]
"extends": ["airbnb"]
}
1 change: 0 additions & 1 deletion commands/protractor/src/plugins/reporter/aggregate.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ module.exports = function aggregateReports(reportName, artifactsPath, reports) {
.reduce(reduceTestObject);

if (sumTests) {
console.error(sumTests);
const fileName = path.resolve(artifactsPath, `${reportName}.json`);
fs.writeFileSync(fileName, JSON.stringify(sumTests, null, '\t'));
report.generate(fileName);
Expand Down
343 changes: 343 additions & 0 deletions docs/cdp-options.md

Large diffs are not rendered by default.

287 changes: 1 addition & 286 deletions docs/cdp.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
id: cdp
id: chrome
title: Chrome
---

Expand All @@ -11,288 +11,3 @@ npx aw chrome -c ./path/to/aw.config.js -w --coverage

and start testing. It will only rerun affected tests and generate coverage accordingly.
Add files, remove files as you go and change your tests to rapidly build up a test coverage.

## Options

### --config

| Description | Type | Default | Alias |
| -------------------- | ------ | ------- | ----- |
| Path to config file. | string | null | -c |

---

### --url

| Description | Type | Default |
| ----------------- | ------ | ------- |
| Url to html file. | string | null |

---

### --glob

| Description | Type | Default |
| ------------------ | ----- | ----------------------------- |
| Test glob pattern. | array | ['test/\*\*/\*.spec.{js,ts}'] |

---

### --watch

| Description | Type | Default |
| ------------------ | ------- | ------- |
| Watch for changes. | boolean | false |

---

### --watchGlob

| Description | Type | Default | Alias |
| ---------------------------------------------------------- | ----- | ---------------------------------------------------- | ----- |
| Glob pattern for watching files that will trigger a rerun. | array | ['src/\*\*/\*.{js,ts}', 'test/\*\*/\*.spec.{js,ts}'] | -wg |

---

### --coverage

| Description | Type | Default |
| ------------------ | ------- | ------- |
| Generate coverage. | boolean | false |

---

### --babel.enable

| Description | Type | Default |
| ---------------------------- | ------- | ------- |
| Enables babel tranformation. | boolean | true |

---

### --babel.core

| Description | Type | Default |
| -------------------------- | ------ | ------- |
| Path to babel core module. | string | '' |

---

### --babel.babelPluginIstanbul

| Description | Type | Default |
| ------------------------------------- | ------ | ------- |
| Path to babel plugin istanbul module. | string | '' |

---

### --babel.options

| Description | Type | Default |
| ---------------------- | ------ | ------- |
| Pass options to babel. | object | {} |

---

### --babel.typescript

| Description | Type | Default |
| ----------------------------------- | ------ | ------------ |
| Path to typescript compiler module. | string | 'typescript' |

---

### --transform.typescript.config

| Description | Type | Default |
| ------------------------------- | ------ | --------------- |
| Path to typescript config file. | string | 'tsconfig.json' |

---

### --transform.typescript.babelOptions

| Description | Type | Default |
| ---------------------- | ------ | ------- |
| Pass options to babel. | object | {} |

---

### --transform.include

| Description | Type | Default |
| -------------------------------- | ----- | ------- |
| Include glob for transformation. | array | [] |

---

### --transform.exclude

| Description | Type | Default |
| -------------------------------- | ----- | ------- |
| Exclude glob for transformation. | array | [] |

---

### --transform.defaultExclude

| Description | Type | Default |
| ---------------------------------------- | ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Default exclude glob for transformation. | array | ['\*\*/coverage/\*\*','\*\*/external/\*\*','\*\*/autogenerated/\*\*','\*\*/\*.(html|css|json|txt|ttf|woff|svg\)','\*\*/\*require\*.js','\*\*/\*sinon\*.js','\*\*/\*chai\*.js'] |

---


### --instrument.include

| Description | Type | Default |
| --------------------------------- | ----- | ------- |
| Include glob for instrumentation. | array | [] |

---

### --instrument.exclude

| Description | Type | Default |
| --------------------------------- | ----- | ------- |
| Exclude glob for instrumentation. | array | [] |

---

### --instrument.defaultExclude

| Description | Type | Default |
| ----------------------------------------- | ----- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Default exclude glob for instrumentation. | array | ['\*\*/coverage/\*\*','\*\*/external/\*\*','\*\*/autogenerated/\*\*','\*\*/\*.(html|css|json|txt|ttf|woff|svg)','\*\*/\*require\*.js','\*\*/\*sinon\*.js','\*\*/\*chai\*.js','\*\*/\*.spec.{js,ts}'] |

---

### --mocha.reporter

| Description | Type | Default |
| ---------------------- | ------ | --------- |
| Which reporter to use. | string | undefined |

Check Mochas [**list**](https://mochajs.org/#reporters) for valid options.

---

### --mocha.bail

| Description | Type | Default |
| ---------------- | ------- | ------- |
| Bail on failure. | boolean | true |

---

### --mocha.timeout

| Description | Type | Default |
| -------------- | ------ | --------- |
| Timeout in ms. | number | undefined |

---

### --mocha.ui

| Description | Type | Default |
| -------------------------- | ------ | ------- |
| The test interface to use. | string | 'bdd' |

---

### --mocha.color

| Description | Type | Default |
| --------------------- | ------- | ------- |
| Use colors in output. | boolean | true |

---

### --client.port

| Description | Type | Default |
| ------------ | ------ | ------- |
| Chrome port. | number | 9222 |

---

### --client.launch

| Description | Type | Default |
| -------------- | ------- | ------- |
| Launch Chrome. | boolean | true |

---

### --client.devtools

| Description | Type | Default |
| --------------------------- | ------- | ------- |
| Open Chrome with dev tools. | boolean | false |

---

### --chrome.port

| Description | Type | Default |
| ------------ | ------ | ------- |
| Chrome port. | number | 9222 |

---

### --chrome.flags

| Description | Type | Default |
| ------------- | ----- | ----------------------------------------------------------------- |
| Chrome flags. | array | ['--headless', '--disable-gpu', '--allow-file-access-from-files'] |

---

### --http.port

| Description | Type | Default |
| ----------- | ------ | ------- |
| Http port. | number | 9676 |

---

### --http.root

| Description | Type | Default |
| ---------------------- | ----- | ------- |
| Root folders to serve. | array | ['./'] |

---

### --http.rewrite

| Description | Type | Default |
| --------------- | ------ | ------- |
| Rewrite url(s). | object | {} |

---

### --nyc.tempDirectory

| Description | Type | Default |
| ------------------------------------------------ | ------ | ------------------------ |
| Directory to output raw coverage information to. | string | './coverage/.nyc_output' |

---

### --nyc.reporter

| Description | Type | Default |
| ---------------------------- | ----- | ------------------------ |
| Coverage reporter(s) to use. | array | ['lcov', 'text-summary'] |

---

### --nyc.reportDir

| Description | Type | Default |
| ---------------------------------------- | ------ | ---------- |
| Directory to output coverage reports in. | string | 'coverage' |

---
16 changes: 16 additions & 0 deletions docs/chrome-esm-examples.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
id: chrome-esm-examples
title: Chrome-esm
---

```javascript
// The .js is needed since that's what the browser will request and according to spec
import getA from '../src/a.js'; // eslint-disable-line import/extensions

describe('A', () => {
it('should return "a"', () => {
expect(getA()).to.equal('a');
});
});
```

0 comments on commit 03d3d25

Please sign in to comment.