vendor tsgo
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
// Code generated by convertFourslash; DO NOT EDIT.
|
||||
// To modify this test, run "npm run makemanual importNameCodeFixUMDGlobalReact0"
|
||||
|
||||
package fourslash_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/microsoft/typescript-go/internal/fourslash"
|
||||
"github.com/microsoft/typescript-go/internal/testutil"
|
||||
)
|
||||
|
||||
func TestImportNameCodeFixUMDGlobalReact0(t *testing.T) {
|
||||
fourslash.SkipIfFailing(t)
|
||||
t.Parallel()
|
||||
defer testutil.RecoverAndFail(t, "Panic on fourslash test")
|
||||
const content = `// @jsx: react
|
||||
// @allowSyntheticDefaultImports: false
|
||||
// @module: es2015
|
||||
// @moduleResolution: bundler
|
||||
// @Filename: /node_modules/@types/react/index.d.ts
|
||||
export = React;
|
||||
export as namespace React;
|
||||
declare namespace React {
|
||||
export class Component { render(): JSX.Element | null; }
|
||||
}
|
||||
declare global {
|
||||
namespace JSX {
|
||||
interface Element {}
|
||||
}
|
||||
}
|
||||
// @Filename: /a.tsx
|
||||
[|import { Component } from "react";
|
||||
export class MyMap extends Component { }
|
||||
<MyMap/>;|]
|
||||
// @Filename: /b.tsx
|
||||
[|import { Component } from "react";
|
||||
<></>;|]`
|
||||
f, done := fourslash.NewFourslash(t, nil /*capabilities*/, content)
|
||||
defer done()
|
||||
f.GoToFile(t, "/a.tsx")
|
||||
f.VerifyImportFixAtPosition(t, []string{
|
||||
`import * as React from "react";
|
||||
import { Component } from "react";
|
||||
export class MyMap extends Component { }
|
||||
<MyMap/>;`,
|
||||
}, nil /*preferences*/)
|
||||
f.GoToFile(t, "/b.tsx")
|
||||
f.VerifyImportFixAtPosition(t, []string{
|
||||
`import * as React from "react";
|
||||
import { Component } from "react";
|
||||
<></>;`,
|
||||
}, nil /*preferences*/)
|
||||
}
|
||||
Reference in New Issue
Block a user