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;
+5 -5
View File
@@ -11,9 +11,9 @@ import {
inject,
it,
queryView,
xit,
IS_NODEJS
xit
} from 'angular2/test_lib';
import {DOM} from 'angular2/src/dom/dom_adapter';
import {Lexer, Parser, ChangeDetector, dynamicChangeDetection} from 'angular2/change_detection';
import {Compiler, CompilerCache} from 'angular2/src/core/compiler/compiler';
@@ -86,7 +86,7 @@ export function main() {
});
}));
if (!IS_NODEJS) {
if (DOM.supportsDOMEvents()) {
it("should update the control group values on DOM change", inject([AsyncTestCompleter], (async) => {
var form = new ControlGroup({
"login": new Control("oldValue")
@@ -153,7 +153,7 @@ export function main() {
});
}));
if (!IS_NODEJS) {
if (DOM.supportsDOMEvents()) {
describe("different control types", () => {
it("should support type=checkbox", inject([AsyncTestCompleter], (async) => {
var ctx = new MyComp(new ControlGroup({"checkbox": new Control(true)}));
@@ -305,7 +305,7 @@ export function main() {
});
}));
if (!IS_NODEJS) {
if (DOM.supportsDOMEvents()) {
it("should update the control group values on DOM change", inject([AsyncTestCompleter], (async) => {
var form = new ControlGroup({
"nested": new ControlGroup({