Skip to content
This repository was archived by the owner on Jun 27, 2018. It is now read-only.

Commit 646df2f

Browse files
committed
fix(typescript-1.5): fix test for "let"
1 parent ebaa90d commit 646df2f

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

test/test.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,10 @@ describe('typescript-update', function() {
4242
}, /^Error: L0: Type 'string' is not assignable to type 'number'./);
4343
});
4444

45-
it('throws an error for ES6 "let"', function() {
46-
var src = "let x: number = 1;";
47-
assert.throws(function() {
48-
tss(src);
49-
}, /^Error: L0: 'let' declarations are only available when targeting ECMAScript 6 and higher./);
45+
it('compiles ES6 "let" to "var"', function() {
46+
var src = 'let x: number = 1;';
47+
var expected = 'var x = 1;' + eol;
48+
assert.equal(tss(src), expected);
5049
});
5150

5251
it('throws an error for ES6 Promise', function() {
@@ -63,13 +62,13 @@ describe('typescript-update', function() {
6362
tss = new TypeScriptSimple({target: ts.ScriptTarget.ES6});
6463
});
6564

66-
it('compiles ES6 "let"', function() {
65+
it('compiles ES6 "let" to "let"', function() {
6766
var src = "let x: number = 1;";
6867
var expected = 'let x = 1;' + eol;
6968
assert.equal(tss.compile(src), expected);
7069
});
7170

72-
it('compiles ES6 Promise', function() {
71+
it('does not throw for ES6 Promise', function() {
7372
var src = "var x = new Promise(function (resolve, reject) {" + eol + "});";
7473
var expected = src + eol;
7574
assert.equal(tss.compile(src), expected);

0 commit comments

Comments
 (0)