Clean up test a little

This commit is contained in:
Nathan Shively-Sanders 2017-05-08 11:36:30 -07:00
parent 5ad2ced0c3
commit 2e9143aaf0
2 changed files with 27 additions and 39 deletions

View File

@ -1,42 +1,29 @@
tests/cases/compiler/weird.js(1,1): error TS2304: Cannot find name 'someFunction'.
tests/cases/compiler/weird.js(1,23): error TS7006: Parameter 'BaseClass' implicitly has an 'any' type.
tests/cases/compiler/weird.js(4,17): error TS8009: 'const' can only be used in a .ts file.
tests/cases/compiler/weird.js(4,17): error TS1248: A class member cannot have the 'const' keyword.
tests/cases/compiler/weird.js(5,3): error TS2377: Constructors for derived classes must contain a 'super' call.
tests/cases/compiler/weird.js(6,4): error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class.
tests/cases/compiler/weird.js(8,25): error TS7006: Parameter 'error' implicitly has an 'any' type.
tests/cases/compiler/weird.js(9,54): error TS2663: Cannot find name 'DEFAULT_MESSAGE'. Did you mean the instance member 'this.DEFAULT_MESSAGE'?
tests/cases/compiler/weird.js(6,13): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/compiler/weird.js(9,17): error TS7006: Parameter 'error' implicitly has an 'any' type.
==== tests/cases/compiler/weird.js (8 errors) ====
==== tests/cases/compiler/weird.js (4 errors) ====
someFunction(function(BaseClass) {
~~~~~~~~~~~~
!!! error TS2304: Cannot find name 'someFunction'.
~~~~~~~~~
!!! error TS7006: Parameter 'BaseClass' implicitly has an 'any' type.
'use strict';
class Hello extends BaseClass {
const DEFAULT_MESSAGE = "nop!";
'use strict';
const DEFAULT_MESSAGE = "nop!";
class Hello extends BaseClass {
constructor() {
super();
~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
this.foo = "bar";
}
_render(error) {
~~~~~
!!! error TS8009: 'const' can only be used in a .ts file.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS1248: A class member cannot have the 'const' keyword.
constructor() {
~~~~~~~~~~~~~~~
this.foo = "bar";
~~~~~~~~~~~~~~~~~~~~
~~~~
!!! error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class.
}
~~~
!!! error TS2377: Constructors for derived classes must contain a 'super' call.
_render(error) {
~~~~~
!!! error TS7006: Parameter 'error' implicitly has an 'any' type.
const message = error.message || DEFAULT_MESSAGE;
~~~~~~~~~~~~~~~
!!! error TS2663: Cannot find name 'DEFAULT_MESSAGE'. Did you mean the instance member 'this.DEFAULT_MESSAGE'?
}
}
const message = error.message || DEFAULT_MESSAGE;
}
}
});

View File

@ -5,14 +5,15 @@
// @noEmit: true
// @out: foo.js
someFunction(function(BaseClass) {
'use strict';
class Hello extends BaseClass {
const DEFAULT_MESSAGE = "nop!";
constructor() {
this.foo = "bar";
}
_render(error) {
const message = error.message || DEFAULT_MESSAGE;
}
}
'use strict';
const DEFAULT_MESSAGE = "nop!";
class Hello extends BaseClass {
constructor() {
super();
this.foo = "bar";
}
_render(error) {
const message = error.message || DEFAULT_MESSAGE;
}
}
});