Skip to content

Commit 2e9143a

Browse files
committed
Clean up test a little
1 parent 5ad2ced commit 2e9143a

File tree

2 files changed

+27
-39
lines changed

2 files changed

+27
-39
lines changed
Lines changed: 16 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,29 @@
11
tests/cases/compiler/weird.js(1,1): error TS2304: Cannot find name 'someFunction'.
22
tests/cases/compiler/weird.js(1,23): error TS7006: Parameter 'BaseClass' implicitly has an 'any' type.
3-
tests/cases/compiler/weird.js(4,17): error TS8009: 'const' can only be used in a .ts file.
4-
tests/cases/compiler/weird.js(4,17): error TS1248: A class member cannot have the 'const' keyword.
5-
tests/cases/compiler/weird.js(5,3): error TS2377: Constructors for derived classes must contain a 'super' call.
6-
tests/cases/compiler/weird.js(6,4): error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class.
7-
tests/cases/compiler/weird.js(8,25): error TS7006: Parameter 'error' implicitly has an 'any' type.
8-
tests/cases/compiler/weird.js(9,54): error TS2663: Cannot find name 'DEFAULT_MESSAGE'. Did you mean the instance member 'this.DEFAULT_MESSAGE'?
3+
tests/cases/compiler/weird.js(6,13): error TS2346: Supplied parameters do not match any signature of call target.
4+
tests/cases/compiler/weird.js(9,17): error TS7006: Parameter 'error' implicitly has an 'any' type.
95

106

11-
==== tests/cases/compiler/weird.js (8 errors) ====
7+
==== tests/cases/compiler/weird.js (4 errors) ====
128
someFunction(function(BaseClass) {
139
~~~~~~~~~~~~
1410
!!! error TS2304: Cannot find name 'someFunction'.
1511
~~~~~~~~~
1612
!!! error TS7006: Parameter 'BaseClass' implicitly has an 'any' type.
17-
'use strict';
18-
class Hello extends BaseClass {
19-
const DEFAULT_MESSAGE = "nop!";
13+
'use strict';
14+
const DEFAULT_MESSAGE = "nop!";
15+
class Hello extends BaseClass {
16+
constructor() {
17+
super();
18+
~~~~~~~
19+
!!! error TS2346: Supplied parameters do not match any signature of call target.
20+
this.foo = "bar";
21+
}
22+
_render(error) {
2023
~~~~~
21-
!!! error TS8009: 'const' can only be used in a .ts file.
22-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
23-
!!! error TS1248: A class member cannot have the 'const' keyword.
24-
constructor() {
25-
~~~~~~~~~~~~~~~
26-
this.foo = "bar";
27-
~~~~~~~~~~~~~~~~~~~~
28-
~~~~
29-
!!! error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class.
30-
}
31-
~~~
32-
!!! error TS2377: Constructors for derived classes must contain a 'super' call.
33-
_render(error) {
34-
~~~~~
3524
!!! error TS7006: Parameter 'error' implicitly has an 'any' type.
36-
const message = error.message || DEFAULT_MESSAGE;
37-
~~~~~~~~~~~~~~~
38-
!!! error TS2663: Cannot find name 'DEFAULT_MESSAGE'. Did you mean the instance member 'this.DEFAULT_MESSAGE'?
39-
}
40-
}
25+
const message = error.message || DEFAULT_MESSAGE;
26+
}
27+
}
4128
});
4229

tests/cases/compiler/checkIndexConstraintOfJavascriptClassExpression.ts

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@
55
// @noEmit: true
66
// @out: foo.js
77
someFunction(function(BaseClass) {
8-
'use strict';
9-
class Hello extends BaseClass {
10-
const DEFAULT_MESSAGE = "nop!";
11-
constructor() {
12-
this.foo = "bar";
13-
}
14-
_render(error) {
15-
const message = error.message || DEFAULT_MESSAGE;
16-
}
17-
}
8+
'use strict';
9+
const DEFAULT_MESSAGE = "nop!";
10+
class Hello extends BaseClass {
11+
constructor() {
12+
super();
13+
this.foo = "bar";
14+
}
15+
_render(error) {
16+
const message = error.message || DEFAULT_MESSAGE;
17+
}
18+
}
1819
});

0 commit comments

Comments
 (0)