forked from olov/ng-annotate
-
Notifications
You must be signed in to change notification settings - Fork 27
/
inside_module.js
65 lines (64 loc) · 1.89 KB
/
inside_module.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
module.exports = {
name: "Module dependent annotations",
tests: [
{
name: "Injector invoke",
contextDependent: true,
implicit: true,
input: function(){
$injector.invoke(function($compile) {
$compile(myElement)(scope);
});
},
expected: function(){
$injector.invoke(["$compile", function($compile) {
$compile(myElement)(scope);
}]);
}
},
{
name: "httpProvider",
implicit: true,
contextDependent: true,
input: function(){
$httpProvider.interceptors.push(function($scope) { a });
$httpProvider.responseInterceptors.push(function($scope) { a }, function(a, b) { b }, function() { c });
},
expected: function(){
$httpProvider.interceptors.push(["$scope", function($scope) { a }]);
$httpProvider.responseInterceptors.push(["$scope", function($scope) { a }], ["a", "b", function(a, b) { b }], function() { c });
}
},
{
name: "$routeProvider",
implicit: true,
contextDependent: true,
input: function(){
$routeProvider.when("path", {
controller: function($scope) { a }
}).when("path2", {
controller: function($scope) { b },
resolve: {
zero: function() { a },
more: function($scope, $timeout) { b },
something: "else",
},
dontAlterMe: function(arg) {},
});
},
expected: function(){
$routeProvider.when("path", {
controller: ["$scope", function($scope) { a }]
}).when("path2", {
controller: ["$scope", function($scope) { b }],
resolve: {
zero: function() { a },
more: ["$scope", "$timeout", function($scope, $timeout) { b }],
something: "else",
},
dontAlterMe: function(arg) {},
});
}
}
]
}