diff --git a/lib/app.js b/lib/app.js index d1027df..8b56c13 100644 --- a/lib/app.js +++ b/lib/app.js @@ -42,6 +42,7 @@ class App { this.port = config.port || 8555; // Port testrpc should listen on this.copyNodeModules = config.copyNodeModules || false; // Copy node modules into coverageEnv? + this.copyPackages = config.copyPackages || []; // Only copy specific node_modules packages into coverageEnv this.testrpcOptions = config.testrpcOptions || null; // Options for testrpc-sc this.testCommand = config.testCommand || null; // Optional test command @@ -72,6 +73,14 @@ class App { shell.mkdir(this.coverageDir); shell.cp('-R', files, this.coverageDir); + // Add specific node_modules packages. + if (!this.copyNodeModules && this.copyPackages.length) { + shell.mkdir(this.coverageDir + '/node_modules'); + this.copyNodeModulesPackages.forEach((nodePackage) => { + shell.cp('-rf', 'node_modules/' + nodePackage, this.coverageDir + '/node_modules/'); + }); + } + // Load config if present, accomodate common windows naming. let truffleConfig;