Skip to content
Merged
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
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ module.exports = {
* @param {String} modulePrefix The prefix to the ember module ('app', 'dummy' or the name of the addon).
*/
_instrumentDirectory(appOrAddon, dir, modulePrefix) {
if (fs.existsSync(dir)) {
if (existsSync(dir)) {
let options = appOrAddon.options = appOrAddon.options || {};
options.babel = options.babel || {};
let plugins = options.babel.plugins = options.babel.plugins || [];
Expand Down
23 changes: 10 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
"doc": "doc",
"test": "tests"
},
"repository": "https://github.com/kategengler/ember-cli-code-coverage",
"scripts": {
"node-test": "mocha test/**/*-test.js",
"browser-test": "COVERAGE=true ember test",
"lint:js": "eslint ./*.js addon addon-test-support app config lib server test-support test tests",
"test": "npm run-script lint:js && npm run-script node-test"
},
"repository": "https://github.com/kategengler/ember-cli-code-coverage",
"dependencies": {
"babel-core": "^6.24.1",
"babel-plugin-istanbul": "^4.1.5",
Expand All @@ -31,23 +31,23 @@
"ember-cli-babel": "^6.6.0",
"ember-cli-htmlbars": "^2.0.1",
"ember-cli-version-checker": "^2.0.0",
"exists-sync": "0.0.3",
"exists-sync": "0.0.4",
"extend": "^3.0.0",
"fs-extra": "^0.26.7",
"fs-extra": "^5.0.0",
"istanbul-api": "^1.1.14",
"node-dir": "^0.1.16",
"rsvp": "^3.2.1",
"rsvp": "^4.8.1",
"walk-sync": "^0.3.2"
},
"devDependencies": {
"broccoli-asset-rev": "^2.4.5",
"chai": "^3.5.0",
"chai": "^4.1.2",
"chai-files": "^1.2.0",
"ember-cli": "~3.0.0-beta.2",
"ember-cli-app-version": "^1.0.0",
"ember-cli-changelog": "^0.3.4",
"ember-cli-dependency-checker": "^2.0.0",
"ember-cli-eslint": "^4.2.1",
"ember-cli-htmlbars": "^2.0.1",
"ember-cli-htmlbars-inline-precompile": "^1.0.0",
"ember-cli-inject-live-reload": "^1.4.1",
"ember-cli-qunit": "^4.1.1",
Expand All @@ -56,29 +56,26 @@
"ember-cli-sri": "^2.1.0",
"ember-cli-uglify": "^2.0.0",
"ember-disable-prototype-extensions": "^1.1.2",
"ember-exam": "0.7.0",
"ember-exam": "1.0.0",
"ember-export-application-global": "^2.0.0",
"ember-load-initializers": "^1.0.0",
"ember-maybe-import-regenerator": "^0.1.6",
"ember-resolver": "^4.0.0",
"ember-source": "~3.0.0-beta.1",
"ember-source-channel-url": "^1.0.1",
"ember-try": "^0.2.23",
"eslint": "^4.16.0",
"eslint-plugin-ember": "^5.0.0",
"eslint-plugin-node": "^5.2.1",
"glob": "^7.1.2",
"loader.js": "^4.2.3",
"mocha": "^5.0.0",
"sinon": "^1.17.4"
"rimraf": "^2.6.2",
"sinon": "^4.2.2"
},
"engines": {
"node": "^4.5 || 6.* || >= 7.*"
},
"ember-addon": {
"configPath": "tests/dummy/config",
"versionCompatibility": {
"ember": ">=1.10.0"
}
"configPath": "tests/dummy/config"
}
}
10 changes: 5 additions & 5 deletions test/integration/coverage-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

var fs = require('fs-extra');
var RSVP = require('rsvp');
var remove = RSVP.denodeify(fs.remove);
var rimraf = RSVP.denodeify(require('rimraf'));
var runCommand = require('../helpers/run-command');
var chai = require('chai');
var expect = chai.expect;
Expand All @@ -14,13 +14,13 @@ chai.use(chaiFiles);

describe('`ember test`', function() {
beforeEach(function() {
return remove('coverage*');
return rimraf('coverage*')
});

afterEach(function() {
return RSVP.all([
remove('tests/dummy/config/coverage.js'),
remove('tests/dummy/app/routes/index.js')
rimraf('tests/dummy/config/coverage.js'),
rimraf('tests/dummy/app/routes/index.js')
]);
});

Expand Down Expand Up @@ -93,7 +93,7 @@ describe('`ember test`', function() {
return runCommand('ember', ['test'], {env: {COVERAGE: true}}).then(function() {
expect(dir('coverage')).to.exist;
}).finally(function() {
remove('addon/error-module.js');
rimraf('addon/error-module.js');
});
});

Expand Down
20 changes: 10 additions & 10 deletions test/unit/index-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe('index.js', function() {
}
};
Index.parent = Index.project = Index.app = Index.IstanbulPlugin = null;
sandbox.stub(Index, 'fileLookup', {});
sandbox.stub(Index, 'fileLookup').value({});
});

afterEach(function() {
Expand Down Expand Up @@ -115,7 +115,7 @@ describe('index.js', function() {

describe('_getIncludes', function() {
beforeEach(function() {
sandbox.stub(Index, 'project', { root: process.cwd() });
sandbox.stub(Index, 'project').value({ root: process.cwd() });
});

it('gets files to include from the app directory', function() {
Expand Down Expand Up @@ -332,20 +332,20 @@ describe('index.js', function() {

describe('_instrumentDirectory', function() {
beforeEach(function() {
sandbox.stub(Index, 'IstanbulPlugin', 'istanbul');
sandbox.stub(Index, 'IstanbulPlugin').value('istanbul');
sandbox.stub(Index, '_getExcludes').returns([]);
sandbox.stub(Index, 'project', { root: process.cwd() });
sandbox.stub(Index, 'parent', {
sandbox.stub(Index, 'project').value({ root: process.cwd() });
sandbox.stub(Index, 'parent').value({
name() { return 'my-app' },
});
sandbox.stub(Index, 'app', {});
sandbox.stub(Index, 'app').value({});
});

describe('_instrumentAppDirectory', function() {

describe('for an app', function() {
beforeEach(function() {
sandbox.stub(Index, 'parent', {
sandbox.stub(Index, 'parent').value({
name() { return 'my-app' },
isEmberCLIAddon() { return false }
});
Expand Down Expand Up @@ -380,7 +380,7 @@ describe('index.js', function() {

describe('for an addon', function() {
beforeEach(function() {
sandbox.stub(Index, 'parent', {
sandbox.stub(Index, 'parent').value({
name() { return 'my-app' },
isEmberCLIAddon() { return true }
});
Expand Down Expand Up @@ -476,7 +476,7 @@ describe('index.js', function() {

describe('for an app with no inrepo addons', function() {
beforeEach(function() {
sandbox.stub(Index, 'project', { pkg: { } });
sandbox.stub(Index, 'project').value({ pkg: { } });
sandbox.spy(Index, '_instrumentDirectory');
});

Expand All @@ -491,7 +491,7 @@ describe('index.js', function() {

beforeEach(function() {
sandbox.stub(path, 'basename').returns('my-inrepo-addon');
sandbox.stub(Index, 'project', {
sandbox.stub(Index, 'project').value({
pkg: {
'ember-addon': {
paths: [
Expand Down
Loading