Created
June 26, 2014 04:46
-
-
Save moqada/f7fe29ac8031bad58945 to your computer and use it in GitHub Desktop.
CoffeeScript で AngularJS のテストを書くときに気をつけること ref: http://qiita.com/moqada/items/ebc052415020f178ee76
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Error: [ng:areq] Argument 'fn' is not a function, got $HttpProvider | |
http://errors.angularjs.org/1.3.0-beta.7/ng/areq?p0=fn&p1=not%20a%20function%2C%20got%20%24HttpProvider |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
describe 'Service: sampleHttpInterceptor', -> | |
$httpProvider = null | |
beforeEach module 'sample.http' | |
beforeEach module (_$httpProvider_) -> | |
_$httpProvider_.interceptors.push 'sampleHttpInterceptor' | |
$httpProvider = _$httpProvider_ | |
# ここに null とか undefined とか入れないと落ちる | |
null | |
it 'defined', inject (sampleHttpInterceptor) -> | |
expect(sampleHttpInterceptor).toBeDefined() | |
it 'intercepted', -> | |
expect($httpProvider.interceptors).toContain 'sampleHttpInterceptor' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment