Skip to content

Commit cc2c8f6

Browse files
committed
refactor(test): ts’if compiler integration tests.
1 parent c28952c commit cc2c8f6

File tree

5 files changed

+1566
-1600
lines changed

5 files changed

+1566
-1600
lines changed

modules/angular2/src/core/annotations/decorators.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ library angular2.core.decorators;
22

33
export '../annotations_impl/annotations.dart';
44
export '../annotations_impl/visibility.dart';
5-
6-
/* This file is empty because, Dart does not have decorators. */
5+
export '../annotations_impl/view.dart';
6+
export '../annotations_impl/di.dart';

modules/angular2/src/core/annotations_impl/view.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,10 @@ export class View {
7373
* }
7474
* ```
7575
*/
76-
directives: List<Type>;
76+
// TODO(tbosch): use Type | Binding | List<any> when Dart supports union types,
77+
// as otherwise we would need to import Binding type and Dart would warn
78+
// for an unused import.
79+
directives: List<Type | any | List<any>>;
7780

7881
/**
7982
* Specify a custom renderer for this View.
@@ -89,7 +92,7 @@ export class View {
8992
}: {
9093
templateUrl?: string,
9194
template?: string,
92-
directives?: List<Type>,
95+
directives?: List<Type | any | List<any>>,
9396
renderer?: string
9497
} = {})
9598
{

modules/angular2/src/test_lib/test_lib.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,18 @@ export function proxy() {
1717
var _global: jasmine.GlobalPolluter = <any>(typeof window === 'undefined' ? global : window);
1818

1919
export var afterEach = _global.afterEach;
20-
export var expect = _global.expect;
20+
21+
export interface NgMatchers extends jasmine.Matchers {
22+
toBe(expected: any): boolean;
23+
toEqual(expected: any): boolean;
24+
toBePromise(expected: any): boolean;
25+
toBeAnInstanceOf(expected: any): boolean;
26+
toHaveText(expected: any): boolean;
27+
toImplement(expected: any): boolean;
28+
not: NgMatchers;
29+
}
30+
31+
export var expect: (actual: any) => NgMatchers = <any>_global.expect;
2132

2233
export var IS_DARTIUM = false;
2334

0 commit comments

Comments
 (0)