forked from EmmanuelDemey/eslint-plugin-angular
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdumb-inject.js
38 lines (31 loc) · 1.01 KB
/
dumb-inject.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// example - valid: true
describe(function() {
var $httpBackend;
var $rootScope;
beforeEach(inject(function(_$httpBackend_, _$rootScope_) {
$httpBackend = _$httpBackend_;
$rootScope = _$rootScope_;
}));
beforeEach(function() {
$httpBackend.whenGET('/data').respond([]);
});
});
// example - valid: false, errorMessage: "inject functions may only consist of assignments in the form myService = _myService_"
describe(function() {
var $httpBackend;
var $rootScope;
beforeEach(inject(function(_$httpBackend_, _$rootScope_) {
$httpBackend = _$httpBackend_;
$rootScope = _$rootScope_;
$httpBackend.whenGET('/data').respond([]);
}));
});
// example - valid: false, errorMessage: "'$httpBackend' must be sorted before '$rootScope'"
describe(function() {
var $httpBackend;
var $rootScope;
beforeEach(inject(function(_$httpBackend_, _$rootScope_) {
$rootScope = _$rootScope_;
$httpBackend = _$httpBackend_;
}));
});