Repository navigation
Conversation
There was a problem hiding this comment.
return inject... here?
There was a problem hiding this comment.
Oops. Good catch. And add a test for withprovider and AsyncTestCompleter which is where this would have mattered
|
A couple small comments but overall this looks great, much cleaner! Can we add an example to https://github.com/angular/angular/blob/master/modules/angular2/test/testing/testing_public_spec.ts showing the use of it('should allow inject and done', (done) => {
inject([FancyService] (service) => {
let count = 0;
setInterval(() => {
count++;
if (count > 2) { done(); }
}, 5);
})();
}); |
|
Test timing after all "it" methods are wrapped with (done)=> {} JS(No change): CJS (Maybe little slower after change) |
Remove FunctionWithParamTokens. All test wrappers async, fakeAsync and inject now return just a Function instead of FunctionWithParamTokens. This makes them directly consumable by the test framework. Also the test framework code does not have to handle a union of Function and FunctionWithParamTokens everywhere. The Function returned by the above methods are considered asynchronous by the test framework if they return a Promise, synchronous otherwise.
|
Merging PR #8257 on behalf of @hansl to branch presubmit-hansl-pr-8257. |
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Remove FunctionWithParamTokens.
All test wrappers async, fakeAsync and inject now return just a Function instead of FunctionWithParamTokens. This makes them directly consumable by the test framework. Also the test framework code does not have to handle a union of Function and FunctionWithParamTokens everywhere.
The Function returned by the above are considered asynchronous by the test framework if they return a Promise, synchronous otherwise.