aboutsummaryrefslogtreecommitdiffstats
path: root/packages/sol-tracing-utils
diff options
context:
space:
mode:
Diffstat (limited to 'packages/sol-tracing-utils')
-rw-r--r--packages/sol-tracing-utils/src/collect_coverage_entries.ts2
-rw-r--r--packages/sol-tracing-utils/test/collect_coverage_entries_test.ts3
2 files changed, 3 insertions, 2 deletions
diff --git a/packages/sol-tracing-utils/src/collect_coverage_entries.ts b/packages/sol-tracing-utils/src/collect_coverage_entries.ts
index 964095b53..b32be12dd 100644
--- a/packages/sol-tracing-utils/src/collect_coverage_entries.ts
+++ b/packages/sol-tracing-utils/src/collect_coverage_entries.ts
@@ -15,7 +15,7 @@ export const collectCoverageEntries = (contractSource: string, ignoreRegexp?: Re
const offsetToLocation = getOffsetToLocation(contractSource);
const ignoreRangesBegingingAt = _.isUndefined(ignoreRegexp)
? []
- : gatherRangesToIgnore(contractSource, ignoreRegexp as RegExp);
+ : gatherRangesToIgnore(contractSource, ignoreRegexp);
const visitor = new ASTVisitor(offsetToLocation, ignoreRangesBegingingAt);
parser.visit(ast, visitor);
sourceHashToCoverageEntries[sourceHash] = visitor.getCollectedCoverageEntries();
diff --git a/packages/sol-tracing-utils/test/collect_coverage_entries_test.ts b/packages/sol-tracing-utils/test/collect_coverage_entries_test.ts
index 7832ec316..d3ca8930c 100644
--- a/packages/sol-tracing-utils/test/collect_coverage_entries_test.ts
+++ b/packages/sol-tracing-utils/test/collect_coverage_entries_test.ts
@@ -130,7 +130,8 @@ describe('Collect coverage entries', () => {
solcovIgnoreContractBaseName,
);
const solcovIgnoreContract = fs.readFileSync(solcovIgnoreContractFileName).toString();
- const coverageEntries = collectCoverageEntries(solcovIgnoreContract);
+ const IGNORE_REGEXP = /\/\*\s*solcov\s+ignore\s+next\s*\*\/\s*/gm;
+ const coverageEntries = collectCoverageEntries(solcovIgnoreContract, IGNORE_REGEXP);
const fnIds = _.keys(coverageEntries.fnMap);
expect(fnIds.length).to.be.equal(1);