Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const { execSync } = require('child_process');
const copydir = require('copy-dir');
const replace = require("replace");
const rimraf = require('rimraf');
const fs = require('fs');
const COMPILE_COMMAND = "INPUT_PATH=coverageEnv OUTPUT_PATH=coverageEnv/build/ yarn build:contracts"
const config = {
dir: './source',
skipFiles: [],
copyNodeModules: false,
compileCommand: "echo SKIPPING COMPILE"
}
const app = new App(config);
death((signal, err) => app.cleanUp(err));
rimraf.sync('./coverageEnv');
fs.mkdirSync('./coverageEnv')
copydir.sync('./source/contracts', './coverageEnv/contracts')
app.instrumentTarget();
copydir.sync('./tests/solidity_test_helpers', './coverageEnv/solidity_test_helpers')
replace({
regex: " view | pure ",
replacement: " ",
paths: fs.readdirSync('./coverageEnv/solidity_test_helpers').map(filename => './coverageEnv/solidity_test_helpers/' + filename),
silent: false,