mirror of https://github.com/embarklabs/embark.git
Updated API Documentation (markdown)
parent
03a4bb686c
commit
9e389cf7c7
|
@ -245,6 +245,101 @@ module type: ???
|
||||||
**params**:
|
**params**:
|
||||||
* `{ contractsFiles: any[], cb: function }`
|
* `{ contractsFiles: any[], cb: function }`
|
||||||
|
|
||||||
|
### test-runner
|
||||||
|
|
||||||
|
module type: stack component
|
||||||
|
|
||||||
|
#### API
|
||||||
|
|
||||||
|
##### requests
|
||||||
|
|
||||||
|
name: `tests:run`
|
||||||
|
arguments:
|
||||||
|
* options - {object}
|
||||||
|
* doneCb - {function} called when tests are done
|
||||||
|
|
||||||
|
run tests with given options
|
||||||
|
|
||||||
|
name: `tests:runner:register`
|
||||||
|
arguments:
|
||||||
|
* name - {string} pluginName
|
||||||
|
* matchFn - {function(filepath)} function that returns boolean true if file being matched can be run by the plugin
|
||||||
|
* addFn - {function(filepath)} function that adds the file to the plugin runlist, throws exception if file doesn't match supported by plugin (should run matchFn first)
|
||||||
|
* runFn - {function(options, reporter)} function that runs the plugin
|
||||||
|
|
||||||
|
registers a test runner plugin
|
||||||
|
|
||||||
|
### solidity-tests
|
||||||
|
|
||||||
|
module type: plugin component
|
||||||
|
|
||||||
|
## Description
|
||||||
|
|
||||||
|
* runs test suites written in solidity using remix-tests
|
||||||
|
* ensures existence of the Assert (remix_tests.sol) library
|
||||||
|
* ensures test files include the Assert (remix_tests.sol) import statement and injects that statement to files that don't have it
|
||||||
|
* compiles & deploys contracts that have been added to this test runner, and then runs tests
|
||||||
|
|
||||||
|
### mocha-tests
|
||||||
|
|
||||||
|
module type: plugin component
|
||||||
|
|
||||||
|
## description
|
||||||
|
|
||||||
|
* runs test suites written in javascript using mocha
|
||||||
|
* defines `config` function that gets exported and exposed in the mocha tests
|
||||||
|
* builds, compiles & deploys contracts with the config given
|
||||||
|
* instantiates contracts in vanilla web3
|
||||||
|
* overrides require to return specified contracts
|
||||||
|
|
||||||
|
### deployment
|
||||||
|
|
||||||
|
module type: stack component
|
||||||
|
|
||||||
|
#### API
|
||||||
|
|
||||||
|
##### requests
|
||||||
|
|
||||||
|
name: `deployment:contracts:deploy`
|
||||||
|
arguments:
|
||||||
|
|
||||||
|
* `contractsList` - Array<Contract> - array of [Contract](https://github.com/embark-framework/embark/blob/refactor_5_0_0/packages/embark-contracts-manager/src/contract.ts) objects
|
||||||
|
* `contractDependencies` - `<object(string:[string])>` of dependencies key=contractName, value=<array of contract names>`
|
||||||
|
|
||||||
|
deploys a list of contracts in the order of their dependencies
|
||||||
|
|
||||||
|
name: `deployment:contract:deploy`
|
||||||
|
arguments:
|
||||||
|
* `contract` - `Contract`
|
||||||
|
|
||||||
|
deploy contract
|
||||||
|
|
||||||
|
name: `deployment:deployer:register`
|
||||||
|
arguments:
|
||||||
|
* `blockchainType` - name of the blockchain tech (e.g "ethereum")
|
||||||
|
* `deployerCb` - `(contract, doneCb(err))` function that deploys specified `contract` then on finish calls `doneCb`
|
||||||
|
|
||||||
|
register a deployer for `blockchainType` for example register an ethereum contract deployer
|
||||||
|
|
||||||
|
##### actions
|
||||||
|
|
||||||
|
name: `deployment:deployContracts:beforeAll`
|
||||||
|
description: actions to run before deploying contracts
|
||||||
|
|
||||||
|
name: `deployment:deployContracts:afterAll`
|
||||||
|
description: actions to run after contracts are deployed
|
||||||
|
|
||||||
|
name: `deployment:contract:beforeDeploy`
|
||||||
|
params: {contract: <Contract>}
|
||||||
|
description: actions to run before deploying a contract
|
||||||
|
|
||||||
|
name: `deployment:contract:deployed`
|
||||||
|
params: {contract: <Contract>}
|
||||||
|
description: actions to run after a contract has been deployed
|
||||||
|
|
||||||
|
name: `deployment:contract:shouldDeploy`
|
||||||
|
params: {contract: <Contract>, shouldDeploy: boolean}
|
||||||
|
description: actions to run before deploying a contract, can change the `shouldDeploy` flag
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue