refactor(tests): rename beforeEachBindings -> beforeEachProviders

Change beforeEachBindings to beforeEachProviders but preserve the
@deprecated method beforeEachBindings, in order to keep a working
deprecation warning
This commit is contained in:
Jesper Rønn-Jensen
2015-11-11 14:28:23 +01:00
committed by Jeremy Elbourn
parent 7f783289ab
commit 070d818e68
32 changed files with 49 additions and 49 deletions
@@ -46,7 +46,7 @@ void testSetup() {
reflector.reflectionCapabilities = new ReflectionCapabilities();
// beforeEach configuration:
// - Priority 3: clear the bindings before each test,
// - Priority 2: collect the bindings before each test, see beforeEachBindings(),
// - Priority 2: collect the bindings before each test, see beforeEachProviders(),
// - Priority 1: create the test injector to be used in beforeEach() and it()
gns.beforeEach(() {
@@ -74,7 +74,7 @@ void testSetup() {
*
* Example:
*
* beforeEachBindings(() => [
* beforeEachProviders(() => [
* bind(Compiler).toClass(MockCompiler),
* bind(SomeToken).toValue(myValue),
* ]);
@@ -104,16 +104,16 @@ export function beforeEach(fn: FunctionWithParamTokens | SyncTestFn): void {
*
* Example:
*
* beforeEachBindings(() => [
* beforeEachProviders(() => [
* provide(Compiler, {useClass: MockCompiler}),
* provide(SomeToken, {useValue: myValue}),
* ]);
*/
export function beforeEachProviders(fn): void {
jsmBeforeEach(() => {
var bindings = fn();
if (!bindings) return;
testProviders = [...testProviders, ...bindings];
var providers = fn();
if (!providers) return;
testProviders = [...testProviders, ...providers];
});
}