Skip to content

Commit 817c79c

Browse files
committed
refactor(testability): rename function to get testability
Previously, getting testability was `window.angular2.getTestability` This was because the plan was to export the API to the window as angular2. However, the decision was changed to make this just `angular` in angular@3177576 To decouple testability from the rest of the Angular API, just make it one function, `window.getAngularTestability`.
1 parent a97a226 commit 817c79c

File tree

2 files changed

+3
-13
lines changed

2 files changed

+3
-13
lines changed

modules/angular2/src/core/testability/get_testability.dart

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,9 @@ class PublicTestability implements _JsObjectProxyable {
8585

8686
class GetTestability {
8787
static addToWindow(TestabilityRegistry registry) {
88-
js.context['angular2'] = _jsify({
89-
'getTestability': (Element elem) {
88+
js.context['getAngularTestability'] = _jsify((Element elem) {
9089
Testability testability = registry.findTestabilityInTree(elem);
9190
return _jsify(new PublicTestability(testability));
92-
},
93-
'resumeBootstrap': ([arg]) {},
94-
});
91+
});
9592
}
9693
}

modules/angular2/src/core/testability/get_testability.es6

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,13 @@ class PublicTestability {
1919

2020
export class GetTestability {
2121
static addToWindow(registry: TestabilityRegistry) {
22-
if (!global.angular2) {
23-
global.angular2 = {};
24-
}
25-
global.angular2.getTestability = function(elem): PublicTestability {
22+
global.getAngularTestability = function(elem): PublicTestability {
2623
var testability = registry.findTestabilityInTree(elem);
2724

2825
if (testability == null) {
2926
throw new Error('Could not find testability for element.');
3027
}
3128
return new PublicTestability(testability);
3229
};
33-
global.angular2.resumeBootstrap = function() {
34-
// Intentionally left blank. This will allow Protractor to run
35-
// against angular2 without turning off Angular synchronization.
36-
};
3730
}
3831
}

0 commit comments

Comments
 (0)