Skip to content

Buidler Plugin & Coverage API

Pre-release
Pre-release
Compare
Choose a tag to compare
@cgewecke cgewecke released this 30 Nov 20:23
· 9 commits to beta since this release
212c88f

Hi!

Phase II of solidity-coverage's redesign is complete with this release. A long-standing goal here has been to make the tool more 'library-like' and decouple from any single development platform. beta.3 moves in that direction by:

  • Publishing an API
  • Using the API to create a coverage plugin for the Buidler development platform.

Buidler Plugin 👷‍♀

Buidler is a beautifully written, ultra-fast Ethereum task/test runner. There's also some really interesting work going on over there to develop an alternative JS Ethereum client with Solidity stack traces which is well worth checking out.

To use solidity-coverage with Buidler, install as usual and list it as a plugin in your buidler.config.js

usePlugin('solidity-coverage')

module.exports = {
  networks: {...},
}

Run the 'coverage' task:

npx buidler coverage

Coverage API 🐘

If you're interested in writing your own coverage plugin or have a custom testing setup, you might find the new API useful. You can now access most of this repo's internals by writing:

const CoverageAPI = require('solidity-coverage/api');
const utils = require('solidity-coverage/utils');

Full API documentation is available here

Bug-fixes

  • Fix missing coverage when truffle-config.js used a V4 style solc configuration (#434)
  • Fix crash when test directory contains an empty folder (#432)
  • Fix coverage hanging when used in combination with eth-gas-reporter (#423)