Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1073)

Unified Diff: test/e2e/helloworld.ts

Issue 2225953002: Strip more unused features. (Closed) Base URL: git@github.com:dart-lang/js_facade_gen.git@master
Patch Set: Fix types Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/decorator_test.ts ('k') | test/e2e/lib.ts » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « test/decorator_test.ts ('k') | test/e2e/lib.ts » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698