From 08ea7e185c4074f28852d2d98ac3fe75a2405bce Mon Sep 17 00:00:00 2001 From: Experimental Team Date: Wed, 22 Nov 2017 17:36:28 -0300 Subject: [PATCH] Add specific packages into coverageEnv --- lib/app.js | 9 +++++++++ 1 file changed, 9 insertions(+) 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;