|
|
@ -12,9 +12,10 @@ const shell = require('shelljs'); |
|
|
|
* @param {String} contract <contractName.sol> located in /test/sources/cli/ |
|
|
|
* @param {String} contract <contractName.sol> located in /test/sources/cli/ |
|
|
|
* @param {[type]} test <testName.js> located in /test/cli/ |
|
|
|
* @param {[type]} test <testName.js> located in /test/cli/ |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
module.exports.install = function install(contract, test, config, _trufflejs) { |
|
|
|
module.exports.install = function install(contract, test, config, _trufflejs, _trufflejsName) { |
|
|
|
const configjs = `module.exports = ${JSON.stringify(config)}`; |
|
|
|
const configjs = `module.exports = ${JSON.stringify(config)}`; |
|
|
|
const contractLocation = `./${contract}`; |
|
|
|
const contractLocation = `./${contract}`; |
|
|
|
|
|
|
|
const trufflejsName = _trufflejsName || 'truffle.js';
|
|
|
|
|
|
|
|
|
|
|
|
// Mock migrations
|
|
|
|
// Mock migrations
|
|
|
|
const initialMigration = ` |
|
|
|
const initialMigration = ` |
|
|
@ -64,7 +65,7 @@ module.exports.install = function install(contract, test, config, _trufflejs) { |
|
|
|
shell.cp('./test/sources/cli/Migrations.sol', './mock/contracts/Migrations.sol'); |
|
|
|
shell.cp('./test/sources/cli/Migrations.sol', './mock/contracts/Migrations.sol'); |
|
|
|
fs.writeFileSync('./mock/migrations/1_initial_migration.js', initialMigration); |
|
|
|
fs.writeFileSync('./mock/migrations/1_initial_migration.js', initialMigration); |
|
|
|
fs.writeFileSync('./mock/migrations/2_deploy_contracts.js', deployContracts); |
|
|
|
fs.writeFileSync('./mock/migrations/2_deploy_contracts.js', deployContracts); |
|
|
|
fs.writeFileSync('./mock/truffle.js', trufflejs); |
|
|
|
fs.writeFileSync(`./mock/${trufflejsName}`, trufflejs); |
|
|
|
fs.writeFileSync('./mock/assets/asset.js', asset); |
|
|
|
fs.writeFileSync('./mock/assets/asset.js', asset); |
|
|
|
fs.writeFileSync('./.solcover.js', configjs); |
|
|
|
fs.writeFileSync('./.solcover.js', configjs); |
|
|
|
shell.cp(`./test/cli/${test}`, `./mock/test/${test}`); |
|
|
|
shell.cp(`./test/cli/${test}`, `./mock/test/${test}`); |
|
|
|