|
1 | 1 | import {describe, xit, it, expect, beforeEach, ddescribe, iit, el} from 'angular2/test_lib'; |
2 | 2 |
|
3 | 3 | import {DOM} from 'angular2/src/dom/dom_adapter'; |
4 | | -import {Type, isPresent, BaseException} from 'angular2/src/facade/lang'; |
5 | | -import {assertionsEnabled, isJsObject} from 'angular2/src/facade/lang'; |
| 4 | +import {Type, isPresent, BaseException, assertionsEnabled, isJsObject} from 'angular2/src/facade/lang'; |
| 5 | +import {PromiseWrapper} from 'angular2/src/facade/async'; |
6 | 6 |
|
7 | 7 | import {Injector} from 'angular2/di'; |
8 | | -import {Lexer, Parser, ChangeDetector, dynamicChangeDetection, |
| 8 | +import {Lexer, Parser, dynamicChangeDetection, |
9 | 9 | DynamicChangeDetection, Pipe, PipeRegistry} from 'angular2/change_detection'; |
10 | 10 |
|
11 | 11 | import {Compiler, CompilerCache} from 'angular2/src/core/compiler/compiler'; |
@@ -433,17 +433,19 @@ export function main() { |
433 | 433 | }); |
434 | 434 | }); |
435 | 435 |
|
436 | | - // TODO support these tests with DART e.g. with Promise.catch (JS) transpiled to Future.catchError (DART) |
437 | | - if (assertionsEnabled() && isJsObject({})) { |
| 436 | + if (assertionsEnabled()) { |
438 | 437 |
|
439 | 438 | function expectCompileError(inlineTpl, errMessage, done) { |
440 | 439 | tplResolver.setTemplate(MyComp, new Template({inline: inlineTpl})); |
441 | | - compiler.compile(MyComp).then(() => { |
442 | | - throw new BaseException("Test failure: should not have come here as an exception was expected"); |
443 | | - },(err) => { |
444 | | - expect(err.message).toBe(errMessage); |
445 | | - done(); |
446 | | - }); |
| 440 | + PromiseWrapper.then(compiler.compile(MyComp), |
| 441 | + (value) => { |
| 442 | + done("Test failure: should not have come here as an exception was expected"); |
| 443 | + }, |
| 444 | + (err) => { |
| 445 | + expect(err.message).toEqual(errMessage); |
| 446 | + done(); |
| 447 | + } |
| 448 | + ); |
447 | 449 | } |
448 | 450 |
|
449 | 451 | it('should raise an error if no directive is registered for an unsupported DOM property', (done) => { |
|
0 commit comments