Closed adklempner closed 7 years ago
Huh, I didn't actually know truffle supported this. Do you happen to have an example repo I can test against?
I ran into the issue trying to run SolCover for Zeppelin
Try the feature/contract-directories
branch.
That works! Thank you!
Can I get you to try the feature/contract-directories2
branch, which I will merge into master
if it works for you? Be sure to rm -rf ./node_modules && np install
, as I have made changes to package.json
.
Edited the above comment to have the correct branch in it (i.e. feature/contract-directories2
).
Getting fatal: Couldn't find remote ref feature/contract-directories2
Yep, it sure would be a lot easier for you to test it if I actually pushed the branch.
(Done)
That branch gives an error in instrumentSolidity.js:
/Users/aklempner/Repos/zeppelin-solidity/solcover/instrumentSolidity.js:337
parse[expression.body[x].type](expression.body[x], instrument);
^
TypeError: parse[expression.body[x].type] is not a function
at Object.parse.ContractStatement (/Users/aklempner/Repos/zeppelin-solidity/solcover/instrumentSolidity.js:337:35)
at Object.parse.Program (/Users/aklempner/Repos/zeppelin-solidity/solcover/instrumentSolidity.js:369:34)
at module.exports (/Users/aklempner/Repos/zeppelin-solidity/solcover/instrumentSolidity.js:431:39)
at /Users/aklempner/Repos/zeppelin-solidity/solcover/runCoveredTests.js:37:40
at Array.forEach (native)
at Object.<anonymous> (/Users/aklempner/Repos/zeppelin-solidity/solcover/runCoveredTests.js:31:45)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
Where expression.body[x]
is
{ type: 'StateVariableDeclaration',
name: 'target',
literal:
{ type: 'Type',
literal: 'Target',
members: [],
array_parts: [],
start: 238,
end: 244 },
visibility: null,
is_constant: false,
value: null,
start: 238,
end: 252 }
Looking at the code, there is no function for parse["StateVariableDeclaration"]
@adklempner Fix in progress... very sorry.
@adklempner as a quick fix, if you
$ npm uninstall --save solidity-parser
$ npm install --save solidity-parser
the error above should disappear.
rm -rf ./node_modules && npm install
should also now get it working.
I've merged this, so now master
should work for you.
If there are sub-directories in the original contracts folder, runCoveredTests does not copy the sub-directories or create instrumented versions of the contracts in those directories.