Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "solidity-coverage",
"version": "0.7.0-beta.2",
"version": "0.7.0-beta.3",
"description": "",
"main": "plugins/buidler.plugin.js",
"bin": {
Expand Down Expand Up @@ -53,7 +53,7 @@
"mocha": "5.2.0",
"nyc": "^14.1.1",
"solc": "^0.5.10",
"truffle": "^5.0.31",
"truffle": "5.0.31",
"truffle-config": "^1.1.18"
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
pragma solidity >=0.4.21 <0.6.0;

import "package/AnotherImport.sol";

interface Void {}
27 changes: 14 additions & 13 deletions test/units/truffle/flags.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,20 @@ describe('Truffle Plugin: command line options', function() {

afterEach(() => mock.clean());

// Running out of memory...
it('--usePluginTruffle', async function(){
truffleConfig.usePluginTruffle = true;
truffleConfig.logger = mock.testLogger;

mock.install('Simple', 'simple.js', solcoverConfig);
await plugin(truffleConfig);

assert(
mock.loggerOutput.val.includes('fallback Truffle library module'),
`Should notify it's using plugin truffle lib copy: ${mock.loggerOutput.val}`
);
});

it('--file test/<fileName>', async function() {
truffleConfig.file = path.join(
truffleConfig.working_directory,
Expand Down Expand Up @@ -186,19 +200,6 @@ describe('Truffle Plugin: command line options', function() {
);
});

it('--usePluginTruffle', async function(){
truffleConfig.usePluginTruffle = true;
truffleConfig.logger = mock.testLogger;

mock.install('Simple', 'simple.js', solcoverConfig);
await plugin(truffleConfig);

assert(
mock.loggerOutput.val.includes('fallback Truffle library module'),
`Should notify it's using plugin truffle lib copy: ${mock.loggerOutput.val}`
);
});

it('--temp', async function(){
truffleConfig.logger = mock.testLogger;

Expand Down
19 changes: 18 additions & 1 deletion test/units/truffle/standard.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,26 @@ describe('Truffle Plugin: standard use cases', function() {
verify.lineCoverage(expected);
});

it('with relative path solidity imports', async function() {
it('imports: relative path imports & file w/ only-import statements', async function() {
// Earlier versions of truffle crash on this case (5.0.31)
// Later versions of truffle OOM (5.1.2)
truffleConfig.useGlobalTruffle = true;

mock.installFullProject('import-paths');
await plugin(truffleConfig);

const expected = [
{
file: mock.pathToContract(truffleConfig, 'OnlyUsesImports.sol'),
pct: 100
},
{
file: mock.pathToContract(truffleConfig, 'UsesImports.sol'),
pct: 100,
},
];

verify.lineCoverage(expected);
});

it('uses libraries', async function() {
Expand Down
1 change: 1 addition & 0 deletions test/util/integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const path = require('path');
const fs = require('fs');
const shell = require('shelljs');
const decache = require('decache');
const globalModules = require('global-modules');

const TruffleConfig = require('truffle-config');
const { resetBuidlerContext } = require("@nomiclabs/buidler/plugins-testing")
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7372,7 +7372,7 @@ truffle-provider@^0.1.14:
truffle-interface-adapter "^0.2.3"
web3 "1.2.1"

truffle@^5.0.31:
[email protected]:
version "5.0.31"
resolved "https://registry.yarnpkg.com/truffle/-/truffle-5.0.31.tgz#372a826e330720e29514458ff25750aa2b5efa65"
integrity sha512-dNBH5OFcqHXCaaQO0YGcEtNarIPcToU+tbq+lBph4tI2YjboiwakguvrNCL+cTP4sySKqeg+2QA1W5miyOQGpA==
Expand Down