`remix-tests` is a tool to test Solidity smart contracts. It works underneath Remix IDE plugin "Solidity Unit Testing" which is used to write and run test cases for a contract. Tests are written in Solidity itself. `remix-tests` can be used as CLI and a library too.
`remix-tests` is a tool to test Solidity smart contracts. It works underneath Remix IDE plugin "Solidity Unit Testing" which is used to write and run test cases for a contract. Tests are written in Solidity itself. `remix-tests` can be used as CLI and a library too.
### Installation
### Installation
@ -45,7 +52,7 @@ Note that `TestsAccounts` is filled with all the accounts available in `web3.eth
### How to use
### How to use
#### Command Line
#### As command line interface
* To run all files inside `examples` directory
* To run all files inside `examples` directory
```
```
@ -140,55 +147,62 @@ Running `simple_storage_test.sol` file will output as:
:point_right: remix-test can also be used for continuous integration testing. See example [Su Squares contract](https://github.com/su-squares/ethereum-contract/tree/e542f37d4f8f6c7b07d90a6554424268384a4186) and [Travis build](https://travis-ci.org/su-squares/ethereum-contract/builds/446186067)
:point_right: remix-test can also be used for continuous integration testing. See example [Su Squares contract](https://github.com/su-squares/ethereum-contract/tree/e542f37d4f8f6c7b07d90a6554424268384a4186) and [Travis build](https://travis-ci.org/su-squares/ethereum-contract/builds/446186067)
* `{ type: 'testFailure', value: '<name of testing function>', time: <time taken>, context: '<TestName>', errMsg: '<message in the Assert>' }`
* `{ type: 'testFailure', value: '<name of testing function>', time: <time taken>, context: '<TestName>', errMsg: '<message in the Assert>' }`
`resultCallback(err, object)`
5. `resultCallback(err, object)` - Callback with test results
* `passingNum` - number of passing tests
* `passingNum` - number of passing tests
* `failureNum` - number of failing tests
* `failureNum` - number of failing tests
* `timePassed` - time it took for all the tests to run (in seconds)
* `timePassed` - time it took for all the tests to run (in seconds)
`finalCallback(err)` - called when all tests finish running.
6. `finalCallback(err)` - called when all tests finish running.
`importCb(url, cb)`
7. `importCb(url, cb)` - Callback to resolve imported files
8. `opts` - Custom options
For more details, see parameters' type definitions [here](https://github.com/ethereum/remix/blob/master/remix-tests/src/types.ts).
## Contribute
## Contribute
Please feel free! Open an issue or a pull request. Please conform to [`standard`](https://standardjs.com/) for code styles, and make sure that you add any relevant tests.
Please feel free to open an issue or a pull request.
In case you want to add a code, do have a look to our contribution guidelnes [here](https://github.com/ethereum/remix/blob/master/CONTRIBUTING.md). Reach us in [Gitter](https://gitter.im/ethereum/remix) in case of any queries.