From 3efaed357b6d5f5f97c99fac41e31cebd6e1a561 Mon Sep 17 00:00:00 2001 From: makdonmai Date: Thu, 24 Oct 2019 10:49:16 +0800 Subject: [PATCH] Update: Updating Instrumentor (so that it supports ES6) #58 --- lib/core.js | 4 ++-- package.json | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/core.js b/lib/core.js index 4019468..9475d28 100644 --- a/lib/core.js +++ b/lib/core.js @@ -6,7 +6,7 @@ var istanbul = require('istanbul'), hook = istanbul.hook, Report = istanbul.Report, utils = istanbul.utils, - Instrumenter = istanbul.Instrumenter, + createInstrumenter = require('istanbul-lib-instrument').createInstrumenter, instrumenter = null, TreeSummarizer = istanbul.TreeSummarizer, baselineCoverage = {}; @@ -113,7 +113,7 @@ function hookLoader(matcherOrRoot, opts) { } if (instrumenter) { return; } //already hooked - instrumenter = new Instrumenter(opts); + instrumenter = createInstrumenter(opts); transformer = instrumenter.instrumentSync.bind(instrumenter); postLoadHookFn = postLoadHook(matcherFn, transformer, opts.verbose); diff --git a/package.json b/package.json index e911d12..d0b01a8 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,8 @@ "@lpinca" ], "dependencies": { - "istanbul": "0.4.x", + "istanbul": "^0.4.5", + "istanbul-lib-instrument": "^1.10.1", "express": "4.x", "body-parser": "~1.12.3", "archiver": "0.14.x"