Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ 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`.

## Module Unification
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`

## Using with `--path`
If you intend to use `ember test` with the `--path` flag, you should generate the build
with `coverageEnvVar` set as true. This is because the code is instrumented for
coverage during the build.
Expand Down
8 changes: 6 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -149,8 +150,11 @@ module.exports = {
* @returns {Array<String>} 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);
},

Expand Down
3 changes: 2 additions & 1 deletion lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ function getDefaultConfig() {
coverageEnvVar: 'COVERAGE',
coverageFolder: 'coverage',
excludes: [
'*/mirage/**/*'
'*/mirage/**/*',
'**/*-test*'
],
reporters: [
'html',
Expand Down
7 changes: 7 additions & 0 deletions lib/module-unification.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
'use strict';

module.exports = {
isModuleUnificationProject(project) {
return project && project.isModuleUnification && project.isModuleUnification();
},
};