Skip to content

Commit 2bd5212

Browse files
committed
README updates for 0.6.0
1 parent f671b72 commit 2bd5212

File tree

2 files changed

+16
-28
lines changed

2 files changed

+16
-28
lines changed

README.md

Lines changed: 15 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
[![npm version](https://badge.fury.io/js/solidity-coverage.svg)](https://badge.fury.io/js/solidity-coverage)
55
[![CircleCI](https://circleci.com/gh/sc-forks/solidity-coverage.svg?style=svg)](https://circleci.com/gh/sc-forks/solidity-coverage)
66
[![codecov](https://codecov.io/gh/sc-forks/solidity-coverage/branch/master/graph/badge.svg)](https://codecov.io/gh/sc-forks/solidity-coverage)
7-
[![Stories in Ready](https://badge.waffle.io/sc-forks/solidity-coverage.png?label=ready&title=Ready)](https://waffle.io/sc-forks/solidity-coverage?utm_source=badge)
87

98
### Code coverage for Solidity testing
109
![coverage example](https://cdn-images-1.medium.com/max/800/1*uum8t-31bUaa6dTRVVhj6w.png)
@@ -23,41 +22,30 @@ $ npm install --save-dev solidity-coverage
2322

2423
### Run
2524

26-
#### Option 1
27-
28-
```
29-
$ ./node_modules/.bin/solidity-coverage
30-
```
31-
32-
#### Option 2
33-
3425
```
35-
$ $(npm bin)/solidity-coverage
26+
$ npx solidity-coverage
3627
```
3728

38-
Tests run significantly slower while coverage is being generated. Your contracts are double-compiled
39-
and a 1 to 2 minute delay between the end of the second compilation and the beginning of test execution
40-
is possible if your test suite is large. Large Solidity files can also take a while to instrument.
41-
42-
**Important: breaking change for versions >= `0.5.0`**
43-
+ `solidity-coverage` requires compilation with `solc` >= `0.4.21`. We're prefixing our own
44-
instrumentation events with the `emit` keyword to reduce warnings volume when running the tool.
45-
+ Ternary conditionals (ex: `(x) ? y : z;`) no longer receive branch coverage. There's more info about
46-
why this isn't currently possible at [solidity 3887](https://github.com/ethereum/solidity/issues/3887).
29+
**NB:** for most projects you'll also need to configure a 'coverage' network in
30+
truffle-config.js. See the Network Configuration guide below.
4731

48-
**Important: breaking change for versions >= `0.4.3`**
49-
+ solidity-coverage now expects a globally installed truffle in your environment / on CI. If you
32+
### Usage notes:
33+
+ Requires Solidity pragmas >= `0.5.0`.
34+
+ Tests run more slowly while coverage is being generated.
35+
+ Your contracts will be double-compiled and a (moderately alarming) delay between compilation and
36+
the beginning of test execution is possible if your contracts are large.
37+
+ solidity-coverage expects a globally installed truffle in your environment / on CI. If you
5038
prefer to control which Truffle version your tests are run with, please see the FAQ for
5139
[running truffle as a local dependency](https://github.com/sc-forks/solidity-coverage/blob/master/docs/faq.md#running-truffle-as-a-local-dependency).
52-
53-
+ Solidity fixtures / mocks / tests stored in the `tests/` directory are no longer supported. If your suite uses native Solidity testing or accesses contracts via mocks stored in `tests/` (a la Zeppelin), coverage will trigger test errors because it's unable to rewrite your contract ABIs appropriately. Mocks should be relocated to the root folder's `contracts` directory. More on why this is necessary at issue [146](https://github.com/sc-forks/solidity-coverage/issues/146)
40+
+ Solidity fixtures / mocks stored in the `tests/` directory are no longer supported. If your suite uses native Solidity testing or accesses contracts via mocks stored in `tests/` (a la Zeppelin), coverage will trigger test errors because it's unable to rewrite your contract ABIs appropriately. Mocks should be relocated to the root folder's `contracts` directory. More on why this is necessary at issue [146](https://github.com/sc-forks/solidity-coverage/issues/146)
5441

5542
### Network Configuration
5643

57-
By default, solidity-coverage generates a stub `truffle.js` that accommodates its special gas needs and
58-
connects to a coverage-enabled fork of the ganache-cli client called **testrpc-sc** on port 8555. This special client ships with `solidity-coverage` - there's nothing extra to download. If your tests will run on truffle's development network
59-
using a standard `truffle.js` and ganache-cli instance, you shouldn't have to do any configuration or launch the coverage client separately. If your tests depend on logic or special options added to `truffle.js` you should declare a coverage
60-
network there following the example below.
44+
By default, solidity-coverage connects to a coverage-enabled fork of the ganache-cli client
45+
called **testrpc-sc** on port 8555. (It ships with `solidity-coverage` -
46+
there's nothing extra to download.)
47+
48+
In `truffle-config.js`, add a coverage network following the example below.
6149

6250
**Example**
6351
```javascript

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "solidity-coverage",
3-
"version": "0.6.0-beta.5",
3+
"version": "0.5.12",
44
"description": "",
55
"bin": {
66
"solidity-coverage": "./bin/exec.js"

0 commit comments

Comments
 (0)