mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
51 lines
1.2 KiB
Go
51 lines
1.2 KiB
Go
// Code generated by convertFourslash; DO NOT EDIT.
|
|
// To modify this test, run "npm run makemanual codeFixAddMissingImportForReactJsx1"
|
|
|
|
package fourslash_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/microsoft/typescript-go/internal/fourslash"
|
|
"github.com/microsoft/typescript-go/internal/testutil"
|
|
)
|
|
|
|
func TestCodeFixAddMissingImportForReactJsx1(t *testing.T) {
|
|
fourslash.SkipIfFailing(t)
|
|
t.Parallel()
|
|
defer testutil.RecoverAndFail(t, "Panic on fourslash test")
|
|
const content = `// @jsx: react-jsx
|
|
// @Filename: node_modules/react/index.d.ts
|
|
export declare var React: any;
|
|
// @Filename: node_modules/react/package.json
|
|
{
|
|
"name": "react",
|
|
"types": "./index.d.ts"
|
|
}
|
|
// @Filename: foo.tsx
|
|
export default function Foo(){
|
|
return <></>;
|
|
}
|
|
// @Filename: bar.tsx
|
|
export default function Bar(){
|
|
return <Foo></Foo>;
|
|
}
|
|
// @Filename: package.json
|
|
{
|
|
"dependencies": {
|
|
"react": "*"
|
|
}
|
|
}`
|
|
f, done := fourslash.NewFourslash(t, nil /*capabilities*/, content)
|
|
defer done()
|
|
f.GoToFile(t, "bar.tsx")
|
|
f.VerifyCodeFixAll(t, fourslash.VerifyCodeFixAllOptions{
|
|
FixID: "fixMissingImport",
|
|
NewFileContent: `import Foo from "./foo";
|
|
|
|
export default function Bar(){
|
|
return <Foo></Foo>;
|
|
}`,
|
|
})
|
|
}
|