Skip to content

Commit 09330b8

Browse files
committed
Add new tests
1 parent 96bffce commit 09330b8

File tree

44 files changed

+2289
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+2289
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/index.ts(1,8): error TS1192: Module '"/node_modules/mdast-util-to-string/index"' has no default export.
2+
/index.ts(7,8): error TS2339: Property 'default' does not exist on type 'typeof import("/node_modules/mdast-util-to-string/index")'.
3+
4+
5+
==== /node_modules/mdast-util-to-string/package.json (0 errors) ====
6+
{ "type": "module" }
7+
8+
==== /node_modules/mdast-util-to-string/index.d.ts (0 errors) ====
9+
export function toString(): string;
10+
11+
==== /index.ts (2 errors) ====
12+
import mdast, { toString } from 'mdast-util-to-string';
13+
~~~~~
14+
!!! error TS1192: Module '"/node_modules/mdast-util-to-string/index"' has no default export.
15+
mdast;
16+
mdast.toString();
17+
18+
const mdast2 = await import('mdast-util-to-string');
19+
mdast2.toString();
20+
mdast2.default;
21+
~~~~~~~
22+
!!! error TS2339: Property 'default' does not exist on type 'typeof import("/node_modules/mdast-util-to-string/index")'.
23+
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
//// [tests/cases/compiler/esmNoSynthesizedDefault.ts] ////
2+
3+
//// [package.json]
4+
{ "type": "module" }
5+
6+
//// [index.d.ts]
7+
export function toString(): string;
8+
9+
//// [index.ts]
10+
import mdast, { toString } from 'mdast-util-to-string';
11+
mdast;
12+
mdast.toString();
13+
14+
const mdast2 = await import('mdast-util-to-string');
15+
mdast2.toString();
16+
mdast2.default;
17+
18+
19+
//// [index.js]
20+
import mdast from 'mdast-util-to-string';
21+
mdast;
22+
mdast.toString();
23+
const mdast2 = await import('mdast-util-to-string');
24+
mdast2.toString();
25+
mdast2.default;
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
//// [tests/cases/compiler/esmNoSynthesizedDefault.ts] ////
2+
3+
=== /node_modules/mdast-util-to-string/index.d.ts ===
4+
export function toString(): string;
5+
>toString : Symbol(toString, Decl(index.d.ts, 0, 0))
6+
7+
=== /index.ts ===
8+
import mdast, { toString } from 'mdast-util-to-string';
9+
>mdast : Symbol(mdast, Decl(index.ts, 0, 6))
10+
>toString : Symbol(toString, Decl(index.ts, 0, 15))
11+
12+
mdast;
13+
>mdast : Symbol(mdast, Decl(index.ts, 0, 6))
14+
15+
mdast.toString();
16+
>mdast : Symbol(mdast, Decl(index.ts, 0, 6))
17+
18+
const mdast2 = await import('mdast-util-to-string');
19+
>mdast2 : Symbol(mdast2, Decl(index.ts, 4, 5))
20+
>'mdast-util-to-string' : Symbol("/node_modules/mdast-util-to-string/index", Decl(index.d.ts, 0, 0))
21+
22+
mdast2.toString();
23+
>mdast2.toString : Symbol(toString, Decl(index.d.ts, 0, 0))
24+
>mdast2 : Symbol(mdast2, Decl(index.ts, 4, 5))
25+
>toString : Symbol(toString, Decl(index.d.ts, 0, 0))
26+
27+
mdast2.default;
28+
>mdast2 : Symbol(mdast2, Decl(index.ts, 4, 5))
29+
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
//// [tests/cases/compiler/esmNoSynthesizedDefault.ts] ////
2+
3+
=== /node_modules/mdast-util-to-string/index.d.ts ===
4+
export function toString(): string;
5+
>toString : () => string
6+
7+
=== /index.ts ===
8+
import mdast, { toString } from 'mdast-util-to-string';
9+
>mdast : any
10+
>toString : () => string
11+
12+
mdast;
13+
>mdast : any
14+
15+
mdast.toString();
16+
>mdast.toString() : any
17+
>mdast.toString : any
18+
>mdast : any
19+
>toString : any
20+
21+
const mdast2 = await import('mdast-util-to-string');
22+
>mdast2 : typeof import("/node_modules/mdast-util-to-string/index")
23+
>await import('mdast-util-to-string') : typeof import("/node_modules/mdast-util-to-string/index")
24+
>import('mdast-util-to-string') : Promise<typeof import("/node_modules/mdast-util-to-string/index")>
25+
>'mdast-util-to-string' : "mdast-util-to-string"
26+
27+
mdast2.toString();
28+
>mdast2.toString() : string
29+
>mdast2.toString : () => string
30+
>mdast2 : typeof import("/node_modules/mdast-util-to-string/index")
31+
>toString : () => string
32+
33+
mdast2.default;
34+
>mdast2.default : any
35+
>mdast2 : typeof import("/node_modules/mdast-util-to-string/index")
36+
>default : any
37+
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/index.ts(1,8): error TS1192: Module '"/node_modules/mdast-util-to-string/index"' has no default export.
2+
/index.ts(7,8): error TS2339: Property 'default' does not exist on type 'typeof import("/node_modules/mdast-util-to-string/index")'.
3+
4+
5+
==== /node_modules/mdast-util-to-string/package.json (0 errors) ====
6+
{ "type": "module" }
7+
8+
==== /node_modules/mdast-util-to-string/index.d.ts (0 errors) ====
9+
export function toString(): string;
10+
11+
==== /index.ts (2 errors) ====
12+
import mdast, { toString } from 'mdast-util-to-string';
13+
~~~~~
14+
!!! error TS1192: Module '"/node_modules/mdast-util-to-string/index"' has no default export.
15+
mdast;
16+
mdast.toString();
17+
18+
const mdast2 = await import('mdast-util-to-string');
19+
mdast2.toString();
20+
mdast2.default;
21+
~~~~~~~
22+
!!! error TS2339: Property 'default' does not exist on type 'typeof import("/node_modules/mdast-util-to-string/index")'.
23+
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
//// [tests/cases/compiler/esmNoSynthesizedDefault.ts] ////
2+
3+
//// [package.json]
4+
{ "type": "module" }
5+
6+
//// [index.d.ts]
7+
export function toString(): string;
8+
9+
//// [index.ts]
10+
import mdast, { toString } from 'mdast-util-to-string';
11+
mdast;
12+
mdast.toString();
13+
14+
const mdast2 = await import('mdast-util-to-string');
15+
mdast2.toString();
16+
mdast2.default;
17+
18+
19+
//// [index.js]
20+
import mdast from 'mdast-util-to-string';
21+
mdast;
22+
mdast.toString();
23+
const mdast2 = await import('mdast-util-to-string');
24+
mdast2.toString();
25+
mdast2.default;
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
//// [tests/cases/compiler/esmNoSynthesizedDefault.ts] ////
2+
3+
=== /node_modules/mdast-util-to-string/index.d.ts ===
4+
export function toString(): string;
5+
>toString : Symbol(toString, Decl(index.d.ts, 0, 0))
6+
7+
=== /index.ts ===
8+
import mdast, { toString } from 'mdast-util-to-string';
9+
>mdast : Symbol(mdast, Decl(index.ts, 0, 6))
10+
>toString : Symbol(toString, Decl(index.ts, 0, 15))
11+
12+
mdast;
13+
>mdast : Symbol(mdast, Decl(index.ts, 0, 6))
14+
15+
mdast.toString();
16+
>mdast : Symbol(mdast, Decl(index.ts, 0, 6))
17+
18+
const mdast2 = await import('mdast-util-to-string');
19+
>mdast2 : Symbol(mdast2, Decl(index.ts, 4, 5))
20+
>'mdast-util-to-string' : Symbol("/node_modules/mdast-util-to-string/index", Decl(index.d.ts, 0, 0))
21+
22+
mdast2.toString();
23+
>mdast2.toString : Symbol(toString, Decl(index.d.ts, 0, 0))
24+
>mdast2 : Symbol(mdast2, Decl(index.ts, 4, 5))
25+
>toString : Symbol(toString, Decl(index.d.ts, 0, 0))
26+
27+
mdast2.default;
28+
>mdast2 : Symbol(mdast2, Decl(index.ts, 4, 5))
29+
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
//// [tests/cases/compiler/esmNoSynthesizedDefault.ts] ////
2+
3+
=== /node_modules/mdast-util-to-string/index.d.ts ===
4+
export function toString(): string;
5+
>toString : () => string
6+
7+
=== /index.ts ===
8+
import mdast, { toString } from 'mdast-util-to-string';
9+
>mdast : any
10+
>toString : () => string
11+
12+
mdast;
13+
>mdast : any
14+
15+
mdast.toString();
16+
>mdast.toString() : any
17+
>mdast.toString : any
18+
>mdast : any
19+
>toString : any
20+
21+
const mdast2 = await import('mdast-util-to-string');
22+
>mdast2 : typeof import("/node_modules/mdast-util-to-string/index")
23+
>await import('mdast-util-to-string') : typeof import("/node_modules/mdast-util-to-string/index")
24+
>import('mdast-util-to-string') : Promise<typeof import("/node_modules/mdast-util-to-string/index")>
25+
>'mdast-util-to-string' : "mdast-util-to-string"
26+
27+
mdast2.toString();
28+
>mdast2.toString() : string
29+
>mdast2.toString : () => string
30+
>mdast2 : typeof import("/node_modules/mdast-util-to-string/index")
31+
>toString : () => string
32+
33+
mdast2.default;
34+
>mdast2.default : any
35+
>mdast2 : typeof import("/node_modules/mdast-util-to-string/index")
36+
>default : any
37+
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
error TS5095: Option 'bundler' can only be used when 'module' is set to 'preserve' or to 'es2015' or later.
2+
3+
4+
!!! error TS5095: Option 'bundler' can only be used when 'module' is set to 'preserve' or to 'es2015' or later.
5+
==== /a.ts (0 errors) ====
6+
export const _ = 0;
7+
8+
==== /b.mts (0 errors) ====
9+
export const _ = 0;
10+
11+
==== /c.cts (0 errors) ====
12+
export const _ = 0;
13+
14+
==== /d.js (0 errors) ====
15+
export const _ = 0;
16+
17+
==== /e.mjs (0 errors) ====
18+
export const _ = 0;
19+
20+
==== /f.mjs (0 errors) ====
21+
export const _ = 0;
22+
23+
==== /g.ts (0 errors) ====
24+
import {} from "./a";
25+
import a = require("./a");
26+
27+
==== /h.mts (0 errors) ====
28+
import {} from "./a";
29+
import a = require("./a");
30+
31+
==== /i.cts (0 errors) ====
32+
import {} from "./a";
33+
import a = require("./a");
34+
35+
==== /dummy.ts (0 errors) ====
36+
export {};
37+
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
//// [tests/cases/compiler/impliedNodeFormatEmit1.ts] ////
2+
3+
//// [a.ts]
4+
export const _ = 0;
5+
6+
//// [b.mts]
7+
export const _ = 0;
8+
9+
//// [c.cts]
10+
export const _ = 0;
11+
12+
//// [d.js]
13+
export const _ = 0;
14+
15+
//// [e.mjs]
16+
export const _ = 0;
17+
18+
//// [f.mjs]
19+
export const _ = 0;
20+
21+
//// [g.ts]
22+
import {} from "./a";
23+
import a = require("./a");
24+
25+
//// [h.mts]
26+
import {} from "./a";
27+
import a = require("./a");
28+
29+
//// [i.cts]
30+
import {} from "./a";
31+
import a = require("./a");
32+
33+
//// [dummy.ts]
34+
export {};
35+
36+
37+
//// [a.js]
38+
define(["require", "exports"], function (require, exports) {
39+
"use strict";
40+
Object.defineProperty(exports, "__esModule", { value: true });
41+
exports._ = void 0;
42+
exports._ = 0;
43+
});
44+
//// [b.mjs]
45+
define(["require", "exports"], function (require, exports) {
46+
"use strict";
47+
Object.defineProperty(exports, "__esModule", { value: true });
48+
exports._ = void 0;
49+
exports._ = 0;
50+
});
51+
//// [c.cjs]
52+
define(["require", "exports"], function (require, exports) {
53+
"use strict";
54+
Object.defineProperty(exports, "__esModule", { value: true });
55+
exports._ = void 0;
56+
exports._ = 0;
57+
});
58+
//// [d.js]
59+
define(["require", "exports"], function (require, exports) {
60+
"use strict";
61+
Object.defineProperty(exports, "__esModule", { value: true });
62+
exports._ = void 0;
63+
exports._ = 0;
64+
});
65+
//// [e.mjs]
66+
define(["require", "exports"], function (require, exports) {
67+
"use strict";
68+
Object.defineProperty(exports, "__esModule", { value: true });
69+
exports._ = void 0;
70+
exports._ = 0;
71+
});
72+
//// [f.mjs]
73+
define(["require", "exports"], function (require, exports) {
74+
"use strict";
75+
Object.defineProperty(exports, "__esModule", { value: true });
76+
exports._ = void 0;
77+
exports._ = 0;
78+
});
79+
//// [g.js]
80+
define(["require", "exports"], function (require, exports) {
81+
"use strict";
82+
Object.defineProperty(exports, "__esModule", { value: true });
83+
});
84+
//// [h.mjs]
85+
define(["require", "exports"], function (require, exports) {
86+
"use strict";
87+
Object.defineProperty(exports, "__esModule", { value: true });
88+
});
89+
//// [i.cjs]
90+
define(["require", "exports"], function (require, exports) {
91+
"use strict";
92+
Object.defineProperty(exports, "__esModule", { value: true });
93+
});
94+
//// [dummy.js]
95+
define(["require", "exports"], function (require, exports) {
96+
"use strict";
97+
Object.defineProperty(exports, "__esModule", { value: true });
98+
});

0 commit comments

Comments
 (0)