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: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ env:
matrix:
fast_finish: true
include:
- node_js: "6"
env: NPM_SCRIPT=browser-test
- node_js: "6"
env: NPM_SCRIPT=jscs
- node_js: "6"
Expand Down
4 changes: 2 additions & 2 deletions lib/templates/test-body-footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
if (parts[0] === '{%PROJECT_NAME%}' && parts[1] !== 'tests') {
try {
require(file);
} catch(e) {
throw 'error requiring file for coverage: '+file;
} catch(error) {
console.warn('Error occurred while evaluating `' + file + '`: ' + error.message + '\n' + error.stack);
}
}
});
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
},
"scripts": {
"node-test": "mocha test/**/*-test.js",
"browser-test": "COVERAGE=true ember test",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 'integration' node test runs COVERAGE=true ember test within ember-cli-code-coverage, so this might be extra work.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I see it now here

"lint": "eslint config lib test tests *.js",
"jscs": "jscs lib test",
"test": "npm run-script jscs && npm run-script lint && npm run-script node-test"
Expand Down
17 changes: 17 additions & 0 deletions tests/unit/handle-modules-throwing-on-import-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/* global define */
import { module, test } from 'qunit';


module('invalid modules');

test('noop to setup module for exit handler', function(assert) {
assert.expect(0);

define('ember-cli-code-coverage/fake-module-from-unit-test', [], function() {
// This exists to confirm that modules that throw errors during
// eval, do not fail the build
//
// See https://github.com/kategengler/ember-cli-code-coverage/issues/63 for details.
throw new Error('Error thrown on import!');
});
});