build(platform-browser): exclude node incompatible tests from :test target. (#21053)
PR Close #21053
This commit is contained in:
parent
6b81d1c9b9
commit
533a010b28
|
@ -14,7 +14,8 @@ import {DomRendererFactory2} from '@angular/platform-browser/src/dom/dom_rendere
|
||||||
import {InjectableAnimationEngine} from '../../animations/src/providers';
|
import {InjectableAnimationEngine} from '../../animations/src/providers';
|
||||||
import {el} from '../../testing/src/browser_util';
|
import {el} from '../../testing/src/browser_util';
|
||||||
|
|
||||||
{
|
(function() {
|
||||||
|
if (isNode) return;
|
||||||
describe('AnimationRenderer', () => {
|
describe('AnimationRenderer', () => {
|
||||||
let element: any;
|
let element: any;
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
@ -307,7 +308,7 @@ import {el} from '../../testing/src/browser_util';
|
||||||
expect(renderer.log).toEqual(['begin', 'end']);
|
expect(renderer.log).toEqual(['begin', 'end']);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
})();
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
class MockAnimationEngine extends InjectableAnimationEngine {
|
class MockAnimationEngine extends InjectableAnimationEngine {
|
||||||
|
|
|
@ -17,6 +17,7 @@ import {el} from '../../testing/src/browser_util';
|
||||||
|
|
||||||
{
|
{
|
||||||
describe('BrowserAnimationBuilder', () => {
|
describe('BrowserAnimationBuilder', () => {
|
||||||
|
if (isNode) return;
|
||||||
let element: any;
|
let element: any;
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
element = el('<div></div>');
|
element = el('<div></div>');
|
||||||
|
|
|
@ -132,6 +132,7 @@ function bootstrap(
|
||||||
lightDom: any /** TODO #9100 */;
|
lightDom: any /** TODO #9100 */;
|
||||||
|
|
||||||
describe('bootstrap factory method', () => {
|
describe('bootstrap factory method', () => {
|
||||||
|
if (isNode) return;
|
||||||
let compilerConsole: DummyConsole;
|
let compilerConsole: DummyConsole;
|
||||||
|
|
||||||
beforeEachProviders(() => { return [Log]; });
|
beforeEachProviders(() => { return [Log]; });
|
||||||
|
|
|
@ -12,6 +12,7 @@ import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter';
|
||||||
|
|
||||||
{
|
{
|
||||||
describe('cookies', () => {
|
describe('cookies', () => {
|
||||||
|
if (isNode) return;
|
||||||
it('sets cookie values', () => {
|
it('sets cookie values', () => {
|
||||||
getDOM().setCookie('my test cookie', 'my test value');
|
getDOM().setCookie('my test cookie', 'my test value');
|
||||||
getDOM().setCookie('my other cookie', 'my test value 2');
|
getDOM().setCookie('my other cookie', 'my test value 2');
|
||||||
|
|
|
@ -12,6 +12,7 @@ import {SpyComponentRef, callNgProfilerTimeChangeDetection} from './spies';
|
||||||
|
|
||||||
{
|
{
|
||||||
describe('profiler', () => {
|
describe('profiler', () => {
|
||||||
|
if (isNode) return;
|
||||||
beforeEach(() => { enableDebugTools((<any>new SpyComponentRef())); });
|
beforeEach(() => { enableDebugTools((<any>new SpyComponentRef())); });
|
||||||
|
|
||||||
afterEach(() => { disableDebugTools(); });
|
afterEach(() => { disableDebugTools(); });
|
||||||
|
|
|
@ -14,6 +14,7 @@ import {NAMESPACE_URIS} from '../../src/dom/dom_renderer';
|
||||||
|
|
||||||
{
|
{
|
||||||
describe('DefaultDomRendererV2', () => {
|
describe('DefaultDomRendererV2', () => {
|
||||||
|
if (isNode) return;
|
||||||
let renderer: Renderer2;
|
let renderer: Renderer2;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|
|
@ -13,7 +13,8 @@ import {DomEventsPlugin} from '@angular/platform-browser/src/dom/events/dom_even
|
||||||
import {EventManager, EventManagerPlugin} from '@angular/platform-browser/src/dom/events/event_manager';
|
import {EventManager, EventManagerPlugin} from '@angular/platform-browser/src/dom/events/event_manager';
|
||||||
import {el} from '../../../testing/src/browser_util';
|
import {el} from '../../../testing/src/browser_util';
|
||||||
|
|
||||||
{
|
(function() {
|
||||||
|
if (isNode) return;
|
||||||
let domEventPlugin: DomEventsPlugin;
|
let domEventPlugin: DomEventsPlugin;
|
||||||
let doc: any;
|
let doc: any;
|
||||||
let zone: NgZone;
|
let zone: NgZone;
|
||||||
|
@ -319,7 +320,7 @@ import {el} from '../../../testing/src/browser_util';
|
||||||
expect(receivedEvent).toBe(null);
|
expect(receivedEvent).toBe(null);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
})();
|
||||||
|
|
||||||
/** @internal */
|
/** @internal */
|
||||||
class FakeEventManagerPlugin extends EventManagerPlugin {
|
class FakeEventManagerPlugin extends EventManagerPlugin {
|
||||||
|
|
|
@ -10,6 +10,7 @@ import {HammerGestureConfig, HammerGesturesPlugin} from '@angular/platform-brows
|
||||||
|
|
||||||
{
|
{
|
||||||
describe('HammerGesturesPlugin', () => {
|
describe('HammerGesturesPlugin', () => {
|
||||||
|
if (isNode) return;
|
||||||
|
|
||||||
it('should implement addGlobalEventListener', () => {
|
it('should implement addGlobalEventListener', () => {
|
||||||
const plugin = new HammerGesturesPlugin(document, new HammerGestureConfig());
|
const plugin = new HammerGesturesPlugin(document, new HammerGestureConfig());
|
||||||
|
|
|
@ -11,6 +11,7 @@ import {KeyEventsPlugin} from '@angular/platform-browser/src/dom/events/key_even
|
||||||
|
|
||||||
{
|
{
|
||||||
describe('KeyEventsPlugin', () => {
|
describe('KeyEventsPlugin', () => {
|
||||||
|
if (isNode) return;
|
||||||
|
|
||||||
it('should ignore unrecognized events', () => {
|
it('should ignore unrecognized events', () => {
|
||||||
expect(KeyEventsPlugin.parseEventName('keydown')).toEqual(null);
|
expect(KeyEventsPlugin.parseEventName('keydown')).toEqual(null);
|
||||||
|
|
|
@ -96,7 +96,8 @@ export class SwTestHarness implements ServiceWorkerGlobalScope, Adapter, Context
|
||||||
} as any;
|
} as any;
|
||||||
|
|
||||||
static envIsSupported(): boolean {
|
static envIsSupported(): boolean {
|
||||||
return (typeof URL === 'function') || (typeof require === 'function' && typeof require('url')['parse'] === 'function');
|
return (typeof URL === 'function') ||
|
||||||
|
(typeof require === 'function' && typeof require('url')['parse'] === 'function');
|
||||||
}
|
}
|
||||||
|
|
||||||
time: number;
|
time: number;
|
||||||
|
|
Loading…
Reference in New Issue