From 9e389cf7c718d99b5e71d5ab9122e43f688d247a Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Tue, 24 Dec 2019 13:57:27 -0500 Subject: [PATCH] Updated API Documentation (markdown) --- API-Documentation.md | 95 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) diff --git a/API-Documentation.md b/API-Documentation.md index cd8f1f3..ab975cb 100644 --- a/API-Documentation.md +++ b/API-Documentation.md @@ -245,6 +245,101 @@ module type: ??? **params**: * `{ 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 - array of [Contract](https://github.com/embark-framework/embark/blob/refactor_5_0_0/packages/embark-contracts-manager/src/contract.ts) objects +* `contractDependencies` - `` of dependencies key=contractName, value=` + +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: } +description: actions to run before deploying a contract + +name: `deployment:contract:deployed` +params: {contract: } +description: actions to run after a contract has been deployed + +name: `deployment:contract:shouldDeploy` +params: {contract: , shouldDeploy: boolean} +description: actions to run before deploying a contract, can change the `shouldDeploy` flag