README fixes for options tables (#412)

pull/413/head
cgewecke 5 years ago committed by GitHub
parent 203f81dd37
commit b02ad1f1dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 46
      README.md

@ -20,38 +20,32 @@ find discrepancies between the coverage report and your suite's behavior, please
$ npm install --save-dev solidity-coverage $ npm install --save-dev solidity-coverage
``` ```
### Usage notes: ### Usage notes:
+ For pragma solidity >=0.4.22 <0.6.0 / Petersburg
+ Coverage runs tests a little more slowly. + Coverage runs tests a little more slowly.
+ Coverage distorts gas consumption. + Coverage distorts gas consumption. Tests that check exact gas consumption should be skipped.
+ Coverage launches its own in-process ganache instance. You can + Coverage launches its own in-process ganache server. [ganache options](https://github.com/trufflesuite/ganache-core#options) via the `providerOptions` key in your `.solcover.js` config file.
set [ganache options](https://github.com/trufflesuite/ganache-core#options) via
the `providerOptions` key in your `.solcover.js` config file.
### Truffle V5 ### Truffle V5
Add "solidity-coverage" to your plugins array in `truffle-config.js` **Add** "solidity-coverage" to your plugins array in `truffle-config.js`
```javascript ```javascript
module.exports = { module.exports = {
networks: {...}, networks: {...},
plugins: ["solidity-coverage"] plugins: ["solidity-coverage"]
} }
``` ```
Run **Run**
``` ```
truffle run coverage [options] truffle run coverage [options]
``` ```
### Command Options ### Command Options
| Option | Example | Description | | Option <img width=200/> | Example <img width=700/>| Description <img width=1000/> |
|--------------|--------------------------------|-------------| |--------------|------------------------------------|--------------------------------|
| `--file` | `--file="test/registry/*.js"` | Filename or glob describing a subset of JS tests to run. (Globs must be enclosed by quotes.)| | file | `--file="test/registry/*.js"` | Filename or glob describing a subset of JS tests to run. (Globs must be enclosed by quotes.)|
| `--solcoverjs` | `--solcoverjs ./../.solcover.js` | Relative path from working directory to config. Useful for monorepo packages that share settings. (Path must be "./" prefixed) | | solcoverjs | `--solcoverjs ./../.solcover.js` | Relative path from working directory to config. Useful for monorepo packages that share settings. (Path must be "./" prefixed) |
| `--useGlobalTruffle` | | Force use of truffle library module from globally installed truffle. (Default: false)| | version | | Version info |
| `--usePluginTruffle` | | Force use of truffle library module from plugin provided copy (Truffle v5.0.31.) Requires you have locally installed Truffle V5 <= 5.0.30 (Default: false)| | help | | Usage notes |
| `--version` | | Version info |
| `--help` | | Usage notes |
|<img width=250/>|<img width=500/> |<img width=100/>|
### Config Options ### Config Options
@ -66,17 +60,17 @@ module.exports = {
``` ```
| Option | Type | Default | Description | | Option <img width=200/>| Type <img width=200/> | Default <img width=700/> | Description <img width=1000/> |
| ------ | ---- | ------- | ----------- | | ------ | ---- | ------- | ----------- |
| client | *Object* | require("truffle").ganache | Useful if you need a specific ganache version. (usage: `client: require("ganache-core")`)| | silent | *Boolean* | false | Suppress logging output |
| providerOptions | *Object* | {} | ganache-core options (ex: `network_id: 55`). Complete list of options [here](https://github.com/trufflesuite/ganache-core#options). | | client | *Object* | `require("ganache-core")` | Useful if you need a specific ganache version. |
| skipFiles | *Array* | `['Migrations.sol']` | Array of contracts or folders (with paths expressed relative to the `contracts` directory) that should be skipped when doing instrumentation. `Migrations.sol` is skipped by default, and does not need to be added to this configuration option if it is used. | | providerOptions | *Object* | `{ }` | [ganache-core options](https://github.com/trufflesuite/ganache-core#options) |
| istanbulReporter | *Array* | ['html', 'lcov', 'text'] | Coverage reporters for Istanbul. Optional reporter replaces the default reporters. | | skipFiles | *Array* | `['Migrations.sol']` | Array of contracts or folders (with paths expressed relative to the `contracts` directory) that should be skipped when doing instrumentation. |
| silent | *Boolean* | false | suppress logging output | | istanbulReporter | *Array* | `['html', 'lcov', 'text']` | [Istanbul coverage reporters](https://istanbul.js.org/docs/advanced/alternative-reporters/) |
| onServerReady | *Function* | `async (config) => {}` | Function run when server is ready to receive calls, but before the tests execute. Useful if you need to launch the Oraclize/Provable bridge or have preparatory scripts which rely on the server's availability | | mocha | *Object* | `{ }` | [Mocha options](https://mochajs.org/api/mocha) to merge into existing mocha config. `grep` and `invert` are useful for skipping certain tests under coverage using tags in the test descriptions.|
| onTestsComplete | *Function* | `async (config) => {}` | Function run immediately after the tests | onServerReady | *Function* | | Hook run *after* server is launched, *before* the tests execute. Useful if you need to use the Oraclize bridge or have setup scripts which rely on the server's availability |
complete, but before Istanbul reports are generated. | | onTestsComplete | *Function* | | Hook run *after* the tests complete, *before* Istanbul reports are generated. |
| onIstanbulComplete | *Function* | `async (config) => {}` | Function run immediately after the Istanbul reports are generated, but before the ganache server is shut down. Useful if you need to clean resources up. | | onIstanbulComplete | *Function* | | Hook run *after* the Istanbul reports are generated, *before* the ganache server is shut down. Useful if you need to clean resources up. |

Loading…
Cancel
Save