Merge pull request #84 from sc-forks/lcov-html-bug

Fix lcov html report bug
pull/86/head
c-g-e-w-e-k-e- 7 years ago committed by GitHub
commit d3a37d9d7c
  1. 5
      lib/app.js
  2. 5
      test/app.js

@ -104,7 +104,8 @@ class App {
currentFile = file; currentFile = file;
const contractPath = path.resolve(file); const contractPath = path.resolve(file);
const canonicalPath = contractPath.split(this.coverageDir).join(''); const working = this.workingDir.substring(1);
const canonicalPath = contractPath.split('/coverageEnv').join(working);
const contract = fs.readFileSync(contractPath).toString(); const contract = fs.readFileSync(contractPath).toString();
const instrumentedContractInfo = getInstrumentedVersion(contract, canonicalPath); const instrumentedContractInfo = getInstrumentedVersion(contract, canonicalPath);
fs.writeFileSync(contractPath, instrumentedContractInfo.contract); fs.writeFileSync(contractPath, instrumentedContractInfo.contract);
@ -197,7 +198,7 @@ class App {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
try { try {
this.coverage.generate(this.events, './contracts'); this.coverage.generate(this.events, `${this.workingDir}/contracts`);
const json = JSON.stringify(this.coverage.coverage); const json = JSON.stringify(this.coverage.coverage);
fs.writeFileSync('./coverage.json', json); fs.writeFileSync('./coverage.json', json);

@ -60,6 +60,7 @@ describe('app', () => {
const testConfig = Object.assign({}, config); const testConfig = Object.assign({}, config);
testConfig.testrpcOptions = `--account="${privateKey},${balance}" --port 8777`; testConfig.testrpcOptions = `--account="${privateKey},${balance}" --port 8777`;
testConfig.dir = './mock',
testConfig.norpc = false; testConfig.norpc = false;
testConfig.port = 8777; testConfig.port = 8777;
@ -78,6 +79,7 @@ describe('app', () => {
const testConfig = Object.assign({}, config); const testConfig = Object.assign({}, config);
testConfig.testCommand = 'mocha --timeout 5000 > /dev/null 2>&1'; testConfig.testCommand = 'mocha --timeout 5000 > /dev/null 2>&1';
testConfig.dir = './mock',
testConfig.norpc = false; testConfig.norpc = false;
testConfig.port = 8888; testConfig.port = 8888;
@ -96,6 +98,7 @@ describe('app', () => {
const testConfig = Object.assign({}, config); const testConfig = Object.assign({}, config);
testConfig.testCommand = 'node ../test/util/mockTestCommand.js'; testConfig.testCommand = 'node ../test/util/mockTestCommand.js';
testConfig.dir = './mock',
testConfig.norpc = false; testConfig.norpc = false;
testConfig.port = 8888; testConfig.port = 8888;
@ -115,6 +118,7 @@ describe('app', () => {
const testConfig = Object.assign({}, config); const testConfig = Object.assign({}, config);
testConfig.dir = './mock',
testConfig.norpc = false; testConfig.norpc = false;
testConfig.port = 8889; testConfig.port = 8889;
@ -155,6 +159,7 @@ describe('app', () => {
};`; };`;
const testConfig = Object.assign({}, config); const testConfig = Object.assign({}, config);
testConfig.dir = './mock',
testConfig.norpc = false; testConfig.norpc = false;
testConfig.port = 8555; // Manually inspect that port is actually set to 8999 testConfig.port = 8555; // Manually inspect that port is actually set to 8999

Loading…
Cancel
Save