mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-04 21:53:42 -06:00
Add module setting + test files
This commit is contained in:
parent
8da353e169
commit
40d1719eb7
49
tests/baselines/reference/tsxExternalModuleEmit1.symbols
Normal file
49
tests/baselines/reference/tsxExternalModuleEmit1.symbols
Normal file
@ -0,0 +1,49 @@
|
||||
=== tests/cases/conformance/jsx/react.d.ts ===
|
||||
|
||||
declare module 'react' {
|
||||
class Component<T, U> { }
|
||||
>Component : Symbol(Component, Decl(react.d.ts, 1, 24))
|
||||
>T : Symbol(T, Decl(react.d.ts, 2, 17))
|
||||
>U : Symbol(U, Decl(react.d.ts, 2, 19))
|
||||
}
|
||||
|
||||
=== tests/cases/conformance/jsx/app.tsx ===
|
||||
import * as React from 'react';
|
||||
>React : Symbol(React, Decl(app.tsx, 0, 6))
|
||||
|
||||
// Should see var button_1 = require('./button') here
|
||||
import { Button } from './button';
|
||||
>Button : Symbol(Button, Decl(app.tsx, 3, 8))
|
||||
|
||||
export class App extends React.Component<any, any> {
|
||||
>App : Symbol(App, Decl(app.tsx, 3, 34))
|
||||
>React.Component : Symbol(React.Component, Decl(react.d.ts, 1, 24))
|
||||
>React : Symbol(React, Decl(app.tsx, 0, 6))
|
||||
>Component : Symbol(React.Component, Decl(react.d.ts, 1, 24))
|
||||
|
||||
render() {
|
||||
>render : Symbol(render, Decl(app.tsx, 5, 52))
|
||||
|
||||
return <Button />;
|
||||
>Button : Symbol(Button, Decl(app.tsx, 3, 8))
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
=== tests/cases/conformance/jsx/button.tsx ===
|
||||
import * as React from 'react';
|
||||
>React : Symbol(React, Decl(button.tsx, 0, 6))
|
||||
|
||||
export class Button extends React.Component<any, any> {
|
||||
>Button : Symbol(Button, Decl(button.tsx, 0, 31))
|
||||
>React.Component : Symbol(React.Component, Decl(react.d.ts, 1, 24))
|
||||
>React : Symbol(React, Decl(button.tsx, 0, 6))
|
||||
>Component : Symbol(React.Component, Decl(react.d.ts, 1, 24))
|
||||
|
||||
render() {
|
||||
>render : Symbol(render, Decl(button.tsx, 2, 55))
|
||||
|
||||
return <button>Some button</button>;
|
||||
}
|
||||
|
||||
}
|
||||
53
tests/baselines/reference/tsxExternalModuleEmit1.types
Normal file
53
tests/baselines/reference/tsxExternalModuleEmit1.types
Normal file
@ -0,0 +1,53 @@
|
||||
=== tests/cases/conformance/jsx/react.d.ts ===
|
||||
|
||||
declare module 'react' {
|
||||
class Component<T, U> { }
|
||||
>Component : Component<T, U>
|
||||
>T : T
|
||||
>U : U
|
||||
}
|
||||
|
||||
=== tests/cases/conformance/jsx/app.tsx ===
|
||||
import * as React from 'react';
|
||||
>React : typeof React
|
||||
|
||||
// Should see var button_1 = require('./button') here
|
||||
import { Button } from './button';
|
||||
>Button : typeof Button
|
||||
|
||||
export class App extends React.Component<any, any> {
|
||||
>App : App
|
||||
>React.Component : React.Component<any, any>
|
||||
>React : typeof React
|
||||
>Component : typeof React.Component
|
||||
|
||||
render() {
|
||||
>render : () => any
|
||||
|
||||
return <Button />;
|
||||
><Button /> : any
|
||||
>Button : typeof Button
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
=== tests/cases/conformance/jsx/button.tsx ===
|
||||
import * as React from 'react';
|
||||
>React : typeof React
|
||||
|
||||
export class Button extends React.Component<any, any> {
|
||||
>Button : Button
|
||||
>React.Component : React.Component<any, any>
|
||||
>React : typeof React
|
||||
>Component : typeof React.Component
|
||||
|
||||
render() {
|
||||
>render : () => any
|
||||
|
||||
return <button>Some button</button>;
|
||||
><button>Some button</button> : any
|
||||
>button : any
|
||||
>button : any
|
||||
}
|
||||
|
||||
}
|
||||
32
tests/cases/conformance/jsx/tsxExternalModuleEmit1.tsx
Normal file
32
tests/cases/conformance/jsx/tsxExternalModuleEmit1.tsx
Normal file
@ -0,0 +1,32 @@
|
||||
//@jsx: preserve
|
||||
//@module: commonjs
|
||||
|
||||
//@filename: react.d.ts
|
||||
declare module 'react' {
|
||||
class Component<T, U> { }
|
||||
}
|
||||
|
||||
//@filename: app.tsx
|
||||
import * as React from 'react';
|
||||
|
||||
// Should see var button_1 = require('./button') here
|
||||
import { Button } from './button';
|
||||
|
||||
export class App extends React.Component<any, any> {
|
||||
|
||||
render() {
|
||||
return <Button />;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//@filename: button.tsx
|
||||
import * as React from 'react';
|
||||
|
||||
export class Button extends React.Component<any, any> {
|
||||
|
||||
render() {
|
||||
return <button>Some button</button>;
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user