chore(testing): Refactor test methods to have a uniform interface.

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.

Closes #8257
This commit is contained in:
Vikram Subramanian
2016-04-26 13:06:50 -07:00
committed by vikerman
parent d2efac18ed
commit 35cd0ded22
11 changed files with 186 additions and 272 deletions

View File

@ -79,8 +79,7 @@ dynamic _runInjectableFunction(Function fn) {
tokens.add(token);
}
var injectFn = new FunctionWithParamTokens(tokens, fn, false);
return _testInjector.execute(injectFn);
return _testInjector.execute(tokens, fn);
}
/// Use the test injector to get bindings and run a function.