From e44b8779ee672062c2b5d171ce9fe9fffc8e1228 Mon Sep 17 00:00:00 2001 From: Gaurav Munjal Date: Fri, 1 Jun 2018 16:08:15 -0400 Subject: [PATCH] Fix fileLookup is null in testemMiddleware --- index.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 7e265d8a..f685b05e 100644 --- a/index.js +++ b/index.js @@ -31,6 +31,8 @@ function getPlugins(appOrAddon) { // Regular expression to extract the file extension from a path. const EXT_RE = /\.[^\.]+$/; +let fileLookup = null; + module.exports = { name: 'ember-cli-code-coverage', @@ -45,7 +47,7 @@ module.exports = { included: function(appOrAddon) { this._super.included.apply(this, arguments); - this.fileLookup = {}; + fileLookup = this.fileLookup = {}; this.parentRegistry = appOrAddon.registry; if (!this._registeredWithBabel && this._isCoverageEnabled()) { @@ -102,7 +104,7 @@ module.exports = { attachMiddleware.serverMiddleware(startOptions.app, { configPath: this.project.configPath(), root: this.project.root, - fileLookup: this.fileLookup + fileLookup: fileLookup }); }, @@ -113,7 +115,7 @@ module.exports = { const config = { configPath: this.project.configPath(), root: this.project.root, - fileLookup: this.fileLookup + fileLookup: fileLookup }; // if we're running `ember test --server` use the `serverMiddleware`. if (process.argv.includes('--server') || process.argv.includes('-s')) {