import { ddescribe, describe, xdescribe, it, iit, xit, expect, beforeEach, afterEach, AsyncTestCompleter, inject } from 'angular2/test_lib'; import {IS_DART} from '../platform'; import {CONST_EXPR} from 'angular2/src/core/facade/lang'; import {MapWrapper} from 'angular2/src/core/facade/collection'; import {Promise} from 'angular2/src/core/facade/async'; import {ChangeDetectionCompiler} from 'angular2/src/compiler/change_detector_compiler'; import {HtmlParser} from 'angular2/src/compiler/html_parser'; import { DirectiveMetadata, TypeMetadata, ChangeDetectionMetadata, SourceModule } from 'angular2/src/compiler/api'; import {MockSchemaRegistry} from './template_parser_spec'; import {TemplateParser} from 'angular2/src/compiler/template_parser'; import { Parser, Lexer, ChangeDetectorGenConfig, ChangeDetectionStrategy, ChangeDispatcher, DirectiveIndex, Locals, BindingTarget, ChangeDetector } from 'angular2/src/core/change_detection/change_detection'; import {evalModule} from './eval_module'; import {TestContext, TestDispatcher, TestPipes} from './change_detector_mocks'; // Attention: These module names have to correspond to real modules! const MODULE_NAME = 'angular2/test/compiler/change_detector_compiler_spec'; export function main() { describe('ChangeDetectorCompiler', () => { var domParser: HtmlParser; var parser: TemplateParser; function createCompiler(useJit: boolean): ChangeDetectionCompiler { return new ChangeDetectionCompiler(new ChangeDetectorGenConfig(true, true, false, useJit)); } beforeEach(() => { domParser = new HtmlParser(); parser = new TemplateParser( new Parser(new Lexer()), new MockSchemaRegistry({'invalidProp': false}, {'mappedAttr': 'mappedProp'})); }); describe('compileComponentRuntime', () => { function detectChanges(compiler: ChangeDetectionCompiler, template: string, directives: DirectiveMetadata[] = CONST_EXPR([])): string[] { var type = new TypeMetadata({typeName: 'SomeComp'}); var parsedTemplate = parser.parse(domParser.parse(template, 'TestComp'), directives); var factories = compiler.compileComponentRuntime(type, ChangeDetectionStrategy.Default, parsedTemplate); return testChangeDetector(factories[0]); } it('should watch element properties (no jit)', () => { expect(detectChanges(createCompiler(false), '