From 56e1c7f311b8cd42d1f7d39b5d7c21051a5b1d7e Mon Sep 17 00:00:00 2001 From: Abhilash L R Date: Sat, 22 Sep 2018 12:37:58 +0200 Subject: [PATCH 1/3] Module unification support --- index.js | 8 ++++++-- lib/module-unification.js | 7 +++++++ 2 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 lib/module-unification.js diff --git a/index.js b/index.js index 6d84d182..58273998 100644 --- a/index.js +++ b/index.js @@ -7,6 +7,7 @@ var config = require('./lib/config'); const walkSync = require('walk-sync'); const VersionChecker = require('ember-cli-version-checker'); const concat = require('lodash.concat'); +const isModuleUnificationProject = require('./lib/module-unification').isModuleUnificationProject; function requireBabelPlugin(pluginName) { let plugin = require(pluginName); @@ -149,8 +150,11 @@ module.exports = { * @returns {Array} include paths */ _getIncludesForAppDirectory: function() { - const dir = path.join(this.project.root, 'app'); - let prefix = this.parent.isEmberCLIAddon() ? 'dummy' : this.parent.name(); + let root = isModuleUnificationProject(this.project) ? 'src' : 'app'; + const dir = path.join(this.project.root, root); + let prefix = this.parent.isEmberCLIAddon() + ? 'dummy' + : (isModuleUnificationProject(this.project) ? `${this.parent.name()}/${root}` : this.parent.name()); return this._getIncludesForDir(dir, prefix); }, diff --git a/lib/module-unification.js b/lib/module-unification.js new file mode 100644 index 00000000..aa7f4683 --- /dev/null +++ b/lib/module-unification.js @@ -0,0 +1,7 @@ +'use strict'; + +module.exports = { + isModuleUnificationProject(project) { + return project && project.isModuleUnification && project.isModuleUnification(); + }, +}; From e77e7c1009821bb2e254f780ac5ef96127288e29 Mon Sep 17 00:00:00 2001 From: Abhilash L R Date: Sat, 22 Sep 2018 13:32:10 +0200 Subject: [PATCH 2/3] Update readme with a note --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 36091e2e..e2164ecd 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,8 @@ and then: When running with `parallel` set to true, the final reports can be merged by using `ember coverage-merge`. The final merged output will be stored in the `coverageFolder`. +NOTE: If you are under a module unification based folder structure, you need to ensure that you have `EMBER_CLI_MODULE_UNIFICATION` flag turned to `TRUE` + ## Configuration Configuration is optional. It should be put in a file at `config/coverage.js` (`configPath` configuration in package.json is honored). In addition to this you can configure Istanbul by adding a `.istanbul.yml` file to the root directory of your app (See https://github.com/gotwarlost/istanbul#configuring) From 943d80a8bf6e35fa3d80dab191d25cda752fd57b Mon Sep 17 00:00:00 2001 From: NullVoxPopuli Date: Fri, 5 Oct 2018 06:46:15 -0400 Subject: [PATCH 3/3] exclude co-located tests --- lib/config.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/config.js b/lib/config.js index d139aff0..f5c7eebf 100644 --- a/lib/config.js +++ b/lib/config.js @@ -40,7 +40,8 @@ function getDefaultConfig() { coverageEnvVar: 'COVERAGE', coverageFolder: 'coverage', excludes: [ - '*/mirage/**/*' + '*/mirage/**/*', + '**/*-test*' ], reporters: [ 'html',