Skip to content

Commit 5fa1324

Browse files
committed
Fixes error where app module cannot be imported
When calling `module()` with `inject()`, an error is thrown: ``` Error: [$injector:modulerr] Failed to instantiate module ng due to: TypeError: 'undefined' is not an object (evaluating 'Function.prototype.bind.apply') ``` PhantomJS is not amongst Karma's officially supported browsers. In 1.x, `Function.prototype.bind` isn't defined. Instead of polyfilling, or using Phantom 2.x, it is better to stick with supported browsers. (As an aside, the test was masking over the error. A more specific error, or a message assertion would be better practice).
1 parent 2a2a031 commit 5fa1324

File tree

4 files changed

+5
-7
lines changed

4 files changed

+5
-7
lines changed

karma-dist-concatenated.conf.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ module.exports = function(config) {
1717
'karma-chai',
1818
'karma-sinon-chai',
1919
'karma-chrome-launcher',
20-
'karma-phantomjs-launcher',
2120
'karma-jquery',
2221
'karma-chai-jquery'
2322
],
@@ -67,7 +66,7 @@ module.exports = function(config) {
6766

6867
// start these browsers
6968
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
70-
browsers: ['PhantomJS'],
69+
browsers: ['Chrome'],
7170

7271

7372
// Continuous Integration mode

karma-dist-minified.conf.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ module.exports = function(config) {
1717
'karma-chai',
1818
'karma-sinon-chai',
1919
'karma-chrome-launcher',
20-
'karma-phantomjs-launcher',
2120
'karma-jquery',
2221
'karma-chai-jquery'
2322
],
@@ -67,7 +66,7 @@ module.exports = function(config) {
6766

6867
// start these browsers
6968
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
70-
browsers: ['PhantomJS'],
69+
browsers: ['Chrome'],
7170

7271

7372
// Continuous Integration mode

karma-src.conf.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ module.exports = function(config) {
1515
plugins: [
1616
'karma-jasmine',
1717
'karma-sinon-chai',
18-
'karma-phantomjs-launcher',
18+
'karma-chrome-launcher',
1919
'karma-spec-reporter'
2020
],
2121

@@ -65,7 +65,7 @@ module.exports = function(config) {
6565

6666
// start these browsers
6767
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
68-
browsers: ['PhantomJS'],
68+
browsers: ['Chrome'],
6969

7070

7171
// Continuous Integration mode

test/unit/angular-zendesk-widget/zendeskWidgetSpec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ describe('Angular Zendesk Widget', function() {
88
module('zendeskWidget');
99
expect(function() {
1010
inject()
11-
}).toThrow();
11+
}).toThrowError('Missing accountUrl. Please set in app config via ZendeskWidgetProvider');
1212
});
1313

1414
});

0 commit comments

Comments
 (0)