aboutsummaryrefslogtreecommitdiffstats
path: root/packages/sol-tracing-utils
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2019-01-22 20:02:16 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2019-01-22 20:02:16 +0800
commit7015fc4dbca1aa275b4b771dd1198ca1a72d71cf (patch)
treebfa48ef852110d6fa7fa2f05db33e71d69cb914f /packages/sol-tracing-utils
parent7e60138e9d1a19004b1ad5337d2ee751a777129f (diff)
downloaddexon-0x-contracts-7015fc4dbca1aa275b4b771dd1198ca1a72d71cf.tar.gz
dexon-0x-contracts-7015fc4dbca1aa275b4b771dd1198ca1a72d71cf.tar.zst
dexon-0x-contracts-7015fc4dbca1aa275b4b771dd1198ca1a72d71cf.zip
Fix tests
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);