refactor(test_lib): remove IS_NODEJS

Closes #1015
This commit is contained in:
Marc Laval
2015-03-19 11:35:48 +01:00
parent ab5ed6f2ec
commit 2ff2ce3c6c
14 changed files with 83 additions and 45 deletions
@@ -1,4 +1,4 @@
import {describe, beforeEach, it, expect, ddescribe, iit, SpyObject, el, IS_NODEJS} from 'angular2/test_lib';
import {describe, beforeEach, it, expect, ddescribe, iit, SpyObject, el} from 'angular2/test_lib';
import {ShadowCss} from 'angular2/src/core/compiler/shadow_dom_emulation/shadow_css';
import {RegExpWrapper, StringWrapper} from 'angular2/src/facade/lang';
@@ -91,16 +91,13 @@ export function main() {
expect(StringWrapper.contains(css, '#menu > .bar {;background: blue;}')).toBeTruthy();
});
if (!IS_NODEJS) {
//TODO: reactivate once CSS parser is fixed: https://github.com/reworkcss/css/issues/65
it('should support polyfill-rule', () => {
var css = s("polyfill-rule {content: ':host.foo .bar';background: blue;}", 'a', 'a-host');
expect(css).toEqual('[a-host].foo .bar {background: blue;}');
it('should support polyfill-rule', () => {
var css = s("polyfill-rule {content: ':host.foo .bar';background: blue;}", 'a', 'a-host');
expect(css).toEqual('[a-host].foo .bar {background: blue;}');
css = s('polyfill-rule {content: ":host.foo .bar";background: blue;}', 'a', 'a-host');
expect(css).toEqual('[a-host].foo .bar {background: blue;}');
});
}
css = s('polyfill-rule {content: ":host.foo .bar";background: blue;}', 'a', 'a-host');
expect(css).toEqual('[a-host].foo .bar {background: blue;}');
});
it('should handle ::shadow', () => {
var css = s('x::shadow > y {}', 'a');
@@ -7,7 +7,6 @@ import {
expect,
iit,
inject,
IS_NODEJS,
it,
xit,
} from 'angular2/test_lib';
@@ -54,7 +53,7 @@ export function main() {
"scoped" : new EmulatedScopedShadowDomStrategy(styleInliner, styleUrlResolver, DOM.createElement('div')),
"unscoped" : new EmulatedUnscopedShadowDomStrategy(styleUrlResolver, DOM.createElement('div'))
}
if (!IS_NODEJS) {
if (DOM.supportsNativeShadowDOM()) {
StringMapWrapper.set(strategies, "native", new NativeShadowDomStrategy(styleUrlResolver));
}
+2 -2
View File
@@ -1,4 +1,4 @@
import {describe, xit, it, expect, beforeEach, ddescribe, iit, el, proxy, IS_NODEJS} from 'angular2/test_lib';
import {describe, xit, it, expect, beforeEach, ddescribe, iit, el, proxy} from 'angular2/test_lib';
import {ProtoView, ElementPropertyMemento, DirectivePropertyMemento} from 'angular2/src/core/compiler/view';
import {ProtoElementInjector, ElementInjector, DirectiveBinding} from 'angular2/src/core/compiler/element_injector';
import {EmulatedScopedShadowDomStrategy, NativeShadowDomStrategy} from 'angular2/src/core/compiler/shadow_dom_strategy';
@@ -444,7 +444,7 @@ export function main() {
});
});
if (!IS_NODEJS) {
if (DOM.supportsDOMEvents()) {
describe('event handlers', () => {
var view, ctx, called, receivedEvent, dispatchedEvent;