This change reverts the removal of setBaseTestProviders that was introduced in 8d746e3f6795c8840116f4649a37a1efb4243eb9. Instead, setBaseTestProviders and the providers provided from `@angular/platform-browser-dynamic/testing` and `@angular/server/testing` will still work for the next release, but are deprecated. See 8d746e3f6795c8840116f4649a37a1efb4243eb9 for how to upgrade.
		
			
				
	
	
		
			50 lines
		
	
	
		
			1.7 KiB
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			50 lines
		
	
	
		
			1.7 KiB
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
/**
 | 
						|
 * @license
 | 
						|
 * Copyright Google Inc. All Rights Reserved.
 | 
						|
 *
 | 
						|
 * Use of this source code is governed by an MIT-style license that can be
 | 
						|
 * found in the LICENSE file at https://angular.io/license
 | 
						|
 */
 | 
						|
 | 
						|
import {AppModule, CompilerFactory, OpaqueToken, PLATFORM_COMMON_PROVIDERS, PLATFORM_INITIALIZER, PlatformRef, ReflectiveInjector, assertPlatform, createPlatform, createPlatformFactory, getPlatform} from '@angular/core';
 | 
						|
import {BROWSER_DYNAMIC_TEST_COMPILER_FACTORY, BrowserDynamicTestModule, TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS} from '@angular/platform-browser-dynamic/testing';
 | 
						|
 | 
						|
import {Parse5DomAdapter} from '../src/parse5_adapter';
 | 
						|
 | 
						|
function initServerTests() {
 | 
						|
  Parse5DomAdapter.makeCurrent();
 | 
						|
}
 | 
						|
 | 
						|
/**
 | 
						|
 * @deprecated Use initTestEnvironment with serverTestPlatform instead.
 | 
						|
 */
 | 
						|
export const TEST_SERVER_PLATFORM_PROVIDERS: Array<any /*Type | Provider | any[]*/> =
 | 
						|
    /*@ts2dart_const*/[
 | 
						|
      PLATFORM_COMMON_PROVIDERS,
 | 
						|
      /*@ts2dart_Provider*/ {provide: PLATFORM_INITIALIZER, useValue: initServerTests, multi: true},
 | 
						|
      {provide: CompilerFactory, useValue: BROWSER_DYNAMIC_TEST_COMPILER_FACTORY},
 | 
						|
    ];
 | 
						|
 | 
						|
/**
 | 
						|
 * Platform for testing
 | 
						|
 *
 | 
						|
 * @experimental API related to bootstrapping are still under review.
 | 
						|
 */
 | 
						|
export const serverTestPlatform =
 | 
						|
    createPlatformFactory('serverTest', TEST_SERVER_PLATFORM_PROVIDERS);
 | 
						|
 | 
						|
/**
 | 
						|
 * AppModule for testing.
 | 
						|
 *
 | 
						|
 * @stable
 | 
						|
 */
 | 
						|
@AppModule({modules: [BrowserDynamicTestModule]})
 | 
						|
export class ServerTestModule {
 | 
						|
}
 | 
						|
 | 
						|
/**
 | 
						|
 * @deprecated Use initTestEnvironment with ServerTestModule instead.
 | 
						|
 */
 | 
						|
export const TEST_SERVER_APPLICATION_PROVIDERS: Array<any /*Type | Provider | any[]*/> =
 | 
						|
    TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS;
 |