diff --git a/README.md b/README.md index f32ffe1b..6d9c2342 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` + ## TypeScript integration Steps: 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/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', 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(); + }, +};