import { ddescribe, describe, xdescribe, it, iit, xit, expect, beforeEach, afterEach, AsyncTestCompleter, inject, beforeEachBindings } from 'angular2/test_lib'; import {bind} from 'angular2/src/core/di'; 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 { CompileDirectiveMetadata, CompileTypeMetadata } from 'angular2/src/compiler/directive_metadata'; import { SourceModule, SourceExpression, SourceExpressions, moduleRef } from 'angular2/src/compiler/source_module'; import {TemplateParser} from 'angular2/src/compiler/template_parser'; import { ChangeDetectorGenConfig, ChangeDetectionStrategy, ChangeDispatcher, DirectiveIndex, Locals, BindingTarget, ChangeDetector } from 'angular2/src/core/change_detection/change_detection'; import {evalModule} from './eval_module'; import {TEST_BINDINGS} from './test_bindings'; import {TestContext, TestDispatcher, TestPipes} from './change_detector_mocks'; import {codeGenValueFn, codeGenExportVariable} from 'angular2/src/compiler/util'; // Attention: These module names have to correspond to real modules! const THIS_MODULE = 'angular2/test/compiler/change_detector_compiler_spec'; var THIS_MODULE_REF = moduleRef(THIS_MODULE); export function main() { describe('ChangeDetectorCompiler', () => { beforeEachBindings(() => TEST_BINDINGS); var parser: TemplateParser; var compiler: ChangeDetectionCompiler; beforeEach(inject([TemplateParser, ChangeDetectionCompiler], (_parser, _compiler) => { parser = _parser; compiler = _compiler; })); describe('compileComponentRuntime', () => { function detectChanges(compiler: ChangeDetectionCompiler, template: string, directives: CompileDirectiveMetadata[] = CONST_EXPR([])): string[] { var type = new CompileTypeMetadata({name: 'SomeComp'}); var parsedTemplate = parser.parse(template, directives, 'TestComp'); var factories = compiler.compileComponentRuntime(type, ChangeDetectionStrategy.Default, parsedTemplate); return testChangeDetector(factories[0]); } describe('no jit', () => { beforeEachBindings(() => [ bind(ChangeDetectorGenConfig) .toValue(new ChangeDetectorGenConfig(true, true, false, false)) ]); it('should watch element properties', () => { expect(detectChanges(compiler, '