Skip to content

Commit 1162b72

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') ``` In karma-phantomjs-launcher 1.x, `Function.prototype.bind` isn't defined. Upgrading to 2.x fixes this problem. In addition, it requires phantomjs-prebuilt as a peer dependency. (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 1162b72

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,11 @@
2727
"karma-jasmine": "^0.3.6",
2828
"karma-jquery": "^0.1.0",
2929
"karma-mocha": "^0.1.8",
30-
"karma-phantomjs-launcher": "^0.1.4",
30+
"karma-phantomjs-launcher": "^1.0.0",
3131
"karma-sinon-chai": "^0.2.0",
3232
"karma-spec-reporter": "^0.0.18",
3333
"mocha": "^1.21.4",
34+
"phantomjs-prebuilt": "^2.1.7",
3435
"run-sequence": "^1.0.2",
3536
"sinon": "^1.10.3",
3637
"sinon-chai": "^2.5.0"

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)