Skip to content

Commit 79f564b

Browse files
committed
refactor(core): ts’ify tests
1 parent 23d59df commit 79f564b

27 files changed

+2557
-2855
lines changed

modules/angular2/src/dom/dom_adapter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,5 +114,5 @@ export class DomAdapter {
114114
getHistory() { throw _abstract(); }
115115
getLocation() { throw _abstract(); }
116116
getBaseHref() { throw _abstract(); }
117-
getUserAgent() { throw _abstract(); }
117+
getUserAgent(): string { throw _abstract(); }
118118
}

modules/angular2/src/test_lib/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,6 @@ export function el(html: string) {
4545
var _RE_SPECIAL_CHARS = ['-', '[', ']', '/', '{', '}', '\\', '(', ')', '*', '+', '?', '.', '^', '$', '|'];
4646
var _ESCAPE_RE = RegExpWrapper.create(`[\\${_RE_SPECIAL_CHARS.join('\\')}]`);
4747
export function containsRegexp(input: string): RegExp {
48-
return RegExpWrapper.create(StringWrapper.replaceAllMapped(input, _ESCAPE_RE, (match) => `\\${match[0]}`));
48+
return RegExpWrapper.create(
49+
StringWrapper.replaceAllMapped(input, _ESCAPE_RE, (match) => `\\${match[0]}`));
4950
}
50-

modules/angular2/test/core/annotations/annotations_spec.js renamed to modules/angular2/test/core/annotations/annotations_spec.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,21 @@
11
import {ddescribe, describe, it, iit, expect, beforeEach} from 'angular2/test_lib';
22
import {Directive, onChange} from 'angular2/src/core/annotations_impl/annotations';
33

4-
class DummyDirective extends Directive {
5-
constructor({lifecycle} = {}) { super({lifecycle: lifecycle}); }
6-
}
7-
84
export function main() {
95
describe("Directive", () => {
106
describe("lifecycle", () => {
117
it("should be false when no lifecycle specified", () => {
12-
var d = new DummyDirective();
8+
var d = new Directive();
139
expect(d.hasLifecycleHook(onChange)).toBe(false);
1410
});
1511

1612
it("should be false when the lifecycle does not contain the hook", () => {
17-
var d = new DummyDirective({lifecycle:[]});
13+
var d = new Directive({lifecycle: []});
1814
expect(d.hasLifecycleHook(onChange)).toBe(false);
1915
});
2016

2117
it("should be true otherwise", () => {
22-
var d = new DummyDirective({lifecycle:[onChange]});
18+
var d = new Directive({lifecycle: [onChange]});
2319
expect(d.hasLifecycleHook(onChange)).toBe(true);
2420
});
2521
});

modules/angular2/test/core/application_spec.js

Lines changed: 0 additions & 192 deletions
This file was deleted.

0 commit comments

Comments
 (0)