Skip to content

Commit 28ab3d2

Browse files
authored
More API docs cleanup
1 parent c1d9ea1 commit 28ab3d2

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

docs/api.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# Solidity-Coverage API
22

3-
solidity-coverage tracks which lines are hit as your tests run by instrumenting the contracts with special solidity statements and detecting their execution in a coverage-enabled EVM.
3+
Solidity-coverage tracks which lines are hit as your tests run by instrumenting the contracts with special solidity statements and detecting their execution in a coverage-enabled EVM.
44

55
As such, the API spans the full set of tasks typically required to run a solidity test suite. The
66
table below shows how its core methods relate to the stages of a test run:
77

88
| Test Stage <img width=200/> | API Method <img width=200/> | Description <img width=800/> |
99
|---------------|--------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
1010
| compilation | `instrument` | A **pre-compilation** step: Rewrites contracts and generates an instrumentation data map. |
11-
| client launch | `ganache` | A **substitute** step: Launches a ganache client with coverage collection enabled in its VM. As the client,runs it will mark line/branch hits on the instrumentation data map. |
11+
| client launch | `ganache` | A **substitute** step: Launches a ganache client with coverage collection enabled in its VM. As the client runs it will mark line/branch hits on the instrumentation data map. |
1212
| test | `report` | A **post-test** step: Generates a coverage report from the data collected by the VM after tests complete. |
1313
| exit | `finish` | A **substitute** step: Shuts client down |
1414

@@ -102,10 +102,10 @@ const instrumented = api.instrument(contracts)
102102

103103
## ganache
104104

105-
Enables coverage data collection on an in-process ganache server. By default, will return
106-
a url after server has begun listening on the port specified in the [config](#constructor)
107-
(or 8555 by default). When `autoLaunchServer` is false, method returns`ganache.server`
108-
so the consumer can control the 'server.listen' invocation themselves.
105+
Enables coverage data collection on an in-process ganache server. By default, this method launches
106+
the server, begins listening on the port specified in the [config](#constructor) (or 8555 if unspecified), and
107+
returns a url string. When `autoLaunchServer` is false, method returns `ganache.server` so you can control
108+
the `server.listen` invocation yourself.
109109

110110
**Parameters**
111111

@@ -137,7 +137,7 @@ Generates coverage report using IstanbulJS
137137

138138
**Parameters**
139139

140-
- `istanbulFolder` **String**: (*Optional*) path to folder IstanbulJS will deposit coverage reports in.
140+
- `istanbulFolder` **String**: (*Optional*) path to folder Istanbul will deposit coverage reports in.
141141

142142
Returns **Promise**
143143

@@ -176,7 +176,7 @@ Returns **Object** instrumentation data;
176176
```javascript
177177
const contracts = api.instrument(contracts);
178178
const data = api.getInstrumentationData();
179-
save(data);
179+
save(data); // Pseudo-code
180180
```
181181

182182
-------------
@@ -189,14 +189,14 @@ in a different process.
189189

190190
**Example**
191191
```javascript
192-
const data = load(data);
192+
const data = load(data); // Pseudo-code
193193
api.setIntrumentationData(data);
194194

195195
// Client will collect data for the loaded map
196196
const address = await api.ganache(client);
197197

198198
// Or to `report` instrumentation data which was collected in a different process.
199-
const data = load(data);
199+
const data = load(data); // Pseudo-code
200200
api.setInstrumentationData(data);
201201

202202
api.report();
@@ -224,7 +224,7 @@ const config = {
224224

225225
## loadSolcoverJS
226226

227-
Loads `.solcoverjs`. Users may specify [options][7] in `.solcover.js` config file which your
227+
Loads `.solcoverjs`. Users may specify [options][7] in a `.solcover.js` config file which your
228228
application needs to consume.
229229

230230
**Parameters**

0 commit comments

Comments
 (0)