Files
kjol/tools/tsgo/internal/fourslash/tests/gen/importNameCodeFixUMDGlobalReact1_test.go
2026-07-09 16:50:43 -04:00

46 lines
1.2 KiB
Go

// Code generated by convertFourslash; DO NOT EDIT.
// To modify this test, run "npm run makemanual importNameCodeFixUMDGlobalReact1"
package fourslash_test
import (
"testing"
"github.com/microsoft/typescript-go/internal/fourslash"
"github.com/microsoft/typescript-go/internal/testutil"
)
func TestImportNameCodeFixUMDGlobalReact1(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></MyMap>;|]`
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></MyMap>;`,
}, nil /*preferences*/)
}