8000 Add testcase for #3764 · icssjs/TypeScript@1a8200f · GitHub
[go: up one dir, main page]

Skip to content

Commit 1a8200f

Browse files
committed
Add testcase for microsoft#3764
1 parent f682980 commit 1a8200f

File tree

4 files changed

+114
-0
lines changed

4 files changed

+114
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
//// [tests/cases/conformance/jsx/tsxElementResolution19.tsx] ////
2+
3+
//// [react.d.ts]
4+
5+
declare module "react" {
6+
7+
}
8+
9+
//// [file1.tsx]
10+
declare module JSX {
11+
interface Element { }
12+
}
13+
export class MyClass { }
14+
15+
//// [file2.tsx]
16+
17+
// Should not elide React import
18+
import * as React from 'react';
19+
import {MyClass} from './file1';
20+
21+
<MyClass />;
22+
23+
24+
//// [file1.js]
25+
define(["require", "exports"], function (require, exports) {
26+
var MyClass = (function () {
27+
function MyClass() {
28+
}
29+
return MyClass;
30+
})();
31+
exports.MyClass = MyClass;
32+
});
33+
//// [file2.js]
34+
define(["require", "exports", './file1'], function (require, exports, file1_1) {
35+
React.createElement(file1_1.MyClass, null);
36+
});
Lines changed: 28 additions & 0 deletions
< 8000 /tr>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
=== tests/cases/conformance/jsx/react.d.ts ===
2+
3+
No type information for this code.declare module "react" {
4+
No type information for this code.
5+
No type information for this code.}
6+
No type information for this code.
7+
No type information for this code.=== tests/cases/conformance/jsx/file1.tsx ===
8+
declare module JSX {
9+
>JSX : Symbol(JSX, Decl(file1.tsx, 0, 0))
10+
11+
interface Element { }
12+
>Element : Symbol(Element, Decl(file1.tsx, 0, 20))
13+
}
14+
export class MyClass { }
15+
>MyClass : Symbol(MyClass, Decl(file1.tsx, 2, 1))
16+
17+
=== tests/cases/conformance/jsx/file2.tsx ===
18+
19+
// Should not elide React import
20+
import * as React from 'react';
21+
>React : Symbol(React, Decl(file2.tsx, 2, 6))
22+
23+
import {MyClass} from './file1';
24+
>MyClass : Symbol(MyClass, Decl(file2.tsx, 3, 8))
25+
26+
<MyClass />;
27+
>MyClass : Symbol(MyClass, Decl(file2.tsx, 3, 8))
28+
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
=== tests/cases/conformance/jsx/react.d.ts ===
2+
3+
No type information for this code.declare module "react" {
4+
No type information for this code.
5+
No type information for this code.}
6+
No type information for this code.
7+
No type information for this code.=== tests/cases/conformance/jsx/file1.tsx ===
8+
declare module JSX {
9+
>JSX : any
10+
11+
interface Element { }
12+
>Element : Element
13+
}
14+
export class MyClass { }
15+
>MyClass : MyClass
16+
17+
=== tests/cases/conformance/jsx/file2.tsx ===
18+
19+
// Should not elide React import
20+
import * as React from 'react';
21+
>React : typeof React
22+
23+
import {MyClass} from './file1';
24+
>MyClass : typeof MyClass
25+
26+
<MyClass />;
27+
><MyClass /> : any
28+
>MyClass : typeof MyClass
29+
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
//@jsx: react
2+
//@module: amd
3+
4+
//@filename: react.d.ts
5+
declare module "react" {
6+
7+
}
8+
9+
//@filename: file1.tsx
10+
declare module JSX {
11+
interface Element { }
12+
}
13+
export class MyClass { }
14+
15+
//@filename: file2.tsx
16+
17+
// Should not elide React import
18+
import * as React from 'react';
19+
import {MyClass} from './file1';
20+
21+
<MyClass />;

0 commit comments

Comments
 (0)
0