@@ -29,6 +29,9 @@ module.exports.install = function install(contract, test, config, _trufflejs) {
29
29
deployer.deploy(contract);
30
30
};` ;
31
31
32
+ // Mock external asset
33
+ const asset = 'module.exports = { value: true };' ;
34
+
32
35
// Mock truffle.js
33
36
const trufflejs = _trufflejs ||
34
37
@@ -46,6 +49,8 @@ module.exports.install = function install(contract, test, config, _trufflejs) {
46
49
shell . mkdir ( './mock' ) ;
47
50
shell . mkdir ( './mock/contracts' ) ;
48
51
shell . mkdir ( './mock/migrations' ) ;
52
+ shell . mkdir ( './mock/assets' ) ;
53
+ shell . mkdir ( './mock/node_modules' ) ;
49
54
shell . mkdir ( './mock/test' ) ;
50
55
51
56
if ( Array . isArray ( contract ) ) {
@@ -60,15 +65,15 @@ module.exports.install = function install(contract, test, config, _trufflejs) {
60
65
fs . writeFileSync ( './mock/migrations/1_initial_migration.js' , initialMigration ) ;
61
66
fs . writeFileSync ( './mock/migrations/2_deploy_contracts.js' , deployContracts ) ;
62
67
fs . writeFileSync ( './mock/truffle.js' , trufflejs ) ;
68
+ fs . writeFileSync ( './mock/assets/asset.js' , asset ) ;
63
69
fs . writeFileSync ( './.solcover.js' , configjs ) ;
64
70
shell . cp ( `./test/cli/${ test } ` , `./mock/test/${ test } ` ) ;
65
71
} ;
66
72
67
73
/**
68
- * Installs mock truffle project at ./mock with a single contract
74
+ * Installs mock truffle project at ./mock with two contracts - one inherits from the other
69
75
* and test specified by the params.
70
- * @param {String } contract <contractName.sol> located in /test/sources/cli/
71
- * @param {[type] } test <testName.js> located in /test/cli/
76
+ * @param {config } .solcover.js configuration
72
77
*/
73
78
module . exports . installInheritanceTest = function installInheritanceTest ( config ) {
74
79
shell . mkdir ( './mock' ) ;
0 commit comments