Add specific packages into coverageEnv

pull/157/head
Experimental Team 7 years ago committed by GitHub
parent 8582dbf2cc
commit 08ea7e185c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      lib/app.js

@ -42,6 +42,7 @@ class App {
this.port = config.port || 8555; // Port testrpc should listen on this.port = config.port || 8555; // Port testrpc should listen on
this.copyNodeModules = config.copyNodeModules || false; // Copy node modules into coverageEnv? 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.testrpcOptions = config.testrpcOptions || null; // Options for testrpc-sc
this.testCommand = config.testCommand || null; // Optional test command this.testCommand = config.testCommand || null; // Optional test command
@ -72,6 +73,14 @@ class App {
shell.mkdir(this.coverageDir); shell.mkdir(this.coverageDir);
shell.cp('-R', files, 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. // Load config if present, accomodate common windows naming.
let truffleConfig; let truffleConfig;

Loading…
Cancel
Save