| Index: test/e2e/helloworld.ts
|
| diff --git a/test/e2e/helloworld.ts b/test/e2e/helloworld.ts
|
| index 0fc6f98b391117f171b76e61ab6d8f792929ef20..c6464435519d9e0030e76ca0cef1f9a4f6034c3e 100644
|
| --- a/test/e2e/helloworld.ts
|
| +++ b/test/e2e/helloworld.ts
|
| @@ -1,42 +1,8 @@
|
| -/// <reference path="./test.d.ts"/>
|
| -/// <reference path="./typings/es6-promise/es6-promise.d.ts"/>
|
| -import t = require('test/test');
|
| -import {MyClass, MySubclass, SOME_ARRAY} from './lib';
|
| +// TODO(jacobr): create an end-to-end example that uses some real d.ts files.
|
| +// For example: it would be reasonable to test that d3 exports as expected.
|
|
|
| -function callOne<T, U>(a: (t: T) => U, t: T): U {
|
| - return a(t);
|
| +function main(): number {
|
| + return 42;
|
| }
|
|
|
| -/* tslint:disable: no-unused-variable */
|
| -function main(): void {
|
| - /* tslint:enable: no-unused-variable */
|
| - t.test('handles classes', function() {
|
| - let mc = new MyClass('hello');
|
| - t.expect(mc.field.toUpperCase(), t.equals('HELLO WORLD'));
|
| - t.expect(mc.namedParam({x: '!'}), t.equals('hello!'));
|
| - t.expect(mc.namedParam(), t.equals('hello?'));
|
| - });
|
| - t.test('allows subclassing and casts', function() {
|
| - let mc: MyClass;
|
| - mc = new MySubclass('hello');
|
| - t.expect((<MySubclass>mc).subclassField, t.equals('hello world'));
|
| - });
|
| - t.test('string templates', function() {
|
| - t.expect('$mc', t.equals('$mc'));
|
| - let a = 'hello';
|
| - let b = 'world';
|
| - t.expect(`${a} ${b}`, t.equals('hello world'));
|
| - });
|
| - t.test('regexp', function() {
|
| - t.expect(/o\./g.test('fo.o'), t.equals(true));
|
| - t.expect(/o/g.exec('fo.o').length, t.equals(1));
|
| - t.expect(/a(b)/g.exec('ab').length, t.equals(2));
|
| - });
|
| - t.test('const expr', function() { t.expect(SOME_ARRAY[0], t.equals(1)); });
|
| - t.test('generic types fn', function() { t.expect(callOne((a) => a, 1), t.equals(1)); });
|
| -
|
| - t.test('promises', function() {
|
| - let p: Promise<number> = new Promise<number>((resolve) => { resolve(1); });
|
| - p.then((n) => { t.expect(n, t.equals(1)); });
|
| - });
|
| -}
|
| +main();
|
|
|