Skip to content

Commit 7c3f274

Browse files
author
Kanchalai Tanglertsampan
committed
Add tests and baselines
1 parent f16d599 commit 7c3f274

18 files changed

+250
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
tests/cases/conformance/externalModules/multipleExportDefault1.ts(1,25): error TS2528: A module cannot have multiple default exports.
2+
tests/cases/conformance/externalModules/multipleExportDefault1.ts(5,1): error TS2528: A module cannot have multiple default exports.
3+
4+
5+
==== tests/cases/conformance/externalModules/multipleExportDefault1.ts (2 errors) ====
6+
export default function Foo (){
7+
~~~
8+
!!! error TS2528: A module cannot have multiple default exports.
9+
10+
}
11+
12+
export default {
13+
~~~~~~~~~~~~~~~~
14+
uhoh: "another default",
15+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
16+
};
17+
~~
18+
!!! error TS2528: A module cannot have multiple default exports.
19+
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
//// [multipleExportDefault1.ts]
2+
export default function Foo (){
3+
4+
}
5+
6+
export default {
7+
uhoh: "another default",
8+
};
9+
10+
11+
//// [multipleExportDefault1.js]
12+
"use strict";
13+
function Foo() {
14+
}
15+
exports.__esModule = true;
16+
exports["default"] = Foo;
17+
exports.__esModule = true;
18+
exports["default"] = {
19+
uhoh: "another default"
20+
};
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
tests/cases/conformance/externalModules/multipleExportDefault2.ts(1,1): error TS2528: A module cannot have multiple default exports.
2+
tests/cases/conformance/externalModules/multipleExportDefault2.ts(5,25): error TS2528: A module cannot have multiple default exports.
3+
4+
5+
==== tests/cases/conformance/externalModules/multipleExportDefault2.ts (2 errors) ====
6+
export default {
7+
~~~~~~~~~~~~~~~~
8+
uhoh: "another default",
9+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10+
};
11+
~~
12+
!!! error TS2528: A module cannot have multiple default exports.
13+
14+
export default function Foo() { }
15+
~~~
16+
!!! error TS2528: A module cannot have multiple default exports.
17+
18+
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//// [multipleExportDefault2.ts]
2+
export default {
3+
uhoh: "another default",
4+
};
5+
6+
export default function Foo() { }
7+
8+
9+
10+
//// [multipleExportDefault2.js]
11+
"use strict";
12+
exports.__esModule = true;
13+
exports["default"] = {
14+
uhoh: "another default"
15+
};
16+
function Foo() { }
17+
exports.__esModule = true;
18+
exports["default"] = Foo;
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
tests/cases/conformance/externalModules/multipleExportDefault3.ts(1,1): error TS2528: A module cannot have multiple default exports.
2+
tests/cases/conformance/externalModules/multipleExportDefault3.ts(5,22): error TS2528: A module cannot have multiple default exports.
3+
4+
5+
==== tests/cases/conformance/externalModules/multipleExportDefault3.ts (2 errors) ====
6+
export default {
7+
~~~~~~~~~~~~~~~~
8+
uhoh: "another default",
9+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10+
};
11+
~~
12+
!!! error TS2528: A module cannot have multiple default exports.
13+
14+
export default class C { }
15+
~
16+
!!! error TS2528: A module cannot have multiple default exports.
17+
18+
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
//// [multipleExportDefault3.ts]
2+
export default {
3+
uhoh: "another default",
4+
};
5+
6+
export default class C { }
7+
8+
9+
10+
//// [multipleExportDefault3.js]
11+
"use strict";
12+
exports.__esModule = true;
13+
exports["default"] = {
14+
uhoh: "another default"
15+
};
16+
var C = (function () {
17+
function C() {
18+
}
19+
return C;
20+
}());
21+
exports.__esModule = true;
22+
exports["default"] = C;
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
tests/cases/conformance/externalModules/multipleExportDefault4.ts(1,22): error TS2528: A module cannot have multiple default exports.
2+
tests/cases/conformance/externalModules/multipleExportDefault4.ts(3,1): error TS2528: A module cannot have multiple default exports.
3+
4+
5+
==== tests/cases/conformance/externalModules/multipleExportDefault4.ts (2 errors) ====
6+
export default class C { }
7+
~
8+
!!! error TS2528: A module cannot have multiple default exports.
9+
10+
export default {
11+
~~~~~~~~~~~~~~~~
12+
uhoh: "another default",
13+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
14+
};
15+
~~
16+
!!! error TS2528: A module cannot have multiple default exports.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
//// [multipleExportDefault4.ts]
2+
export default class C { }
3+
4+
export default {
5+
uhoh: "another default",
6+
};
7+
8+
//// [multipleExportDefault4.js]
9+
"use strict";
10+
var C = (function () {
11+
function C() {
12+
}
13+
return C;
14+
}());
15+
exports.__esModule = true;
16+
exports["default"] = C;
17+
exports.__esModule = true;
18+
exports["default"] = {
19+
uhoh: "another default"
20+
};
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
tests/cases/conformance/externalModules/multipleExportDefault5.ts(1,25): error TS2528: A module cannot have multiple default exports.
2+
tests/cases/conformance/externalModules/multipleExportDefault5.ts(2,22): error TS2528: A module cannot have multiple default exports.
3+
4+
5+
==== tests/cases/conformance/externalModules/multipleExportDefault5.ts (2 errors) ====
6+
export default function bar() { }
7+
~~~
8+
!!! error TS2528: A module cannot have multiple default exports.
9+
export default class C {}
10+
~
11+
!!! error TS2528: A module cannot have multiple default exports.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//// [multipleExportDefault5.ts]
2+
export default function bar() { }
3+
export default class C {}
4+
5+
//// [multipleExportDefault5.js]
6+
"use strict";
7+
function bar() { }
8+
exports.__esModule = true;
9+
exports["default"] = bar;
10+
var C = (function () {
11+
function C() {
12+
}
13+
return C;
14+
}());
15+
exports.__esModule = true;
16+
exports["default"] = C;

0 commit comments

Comments
 (0)