mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
44 lines
1.3 KiB
Go
44 lines
1.3 KiB
Go
// Code generated by convertFourslash; DO NOT EDIT.
|
|
// To modify this test, run "npm run makemanual importNameCodeFix_jsExtension"
|
|
|
|
package fourslash_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/microsoft/typescript-go/internal/fourslash"
|
|
"github.com/microsoft/typescript-go/internal/testutil"
|
|
)
|
|
|
|
func TestImportNameCodeFix_jsExtension(t *testing.T) {
|
|
fourslash.SkipIfFailing(t)
|
|
t.Parallel()
|
|
defer testutil.RecoverAndFail(t, "Panic on fourslash test")
|
|
const content = `// @moduleResolution: bundler
|
|
// @noLib: true
|
|
// @jsx: preserve
|
|
// @Filename: /a.ts
|
|
export function a() {}
|
|
// @Filename: /b.ts
|
|
export function b() {}
|
|
// @Filename: /c.tsx
|
|
export function c() {}
|
|
// @Filename: /c.ts
|
|
import * as g from "global"; // Global imports skipped
|
|
import { a } from "./a.js";
|
|
import { a as a2 } from "./a"; // Ignored, only the first relative import is considered
|
|
b; c;`
|
|
f, done := fourslash.NewFourslash(t, nil /*capabilities*/, content)
|
|
defer done()
|
|
f.GoToFile(t, "/c.ts")
|
|
f.VerifyCodeFixAll(t, fourslash.VerifyCodeFixAllOptions{
|
|
FixID: "fixMissingImport",
|
|
NewFileContent: `import * as g from "global"; // Global imports skipped
|
|
import { a } from "./a.js";
|
|
import { a as a2 } from "./a"; // Ignored, only the first relative import is considered
|
|
import { b } from "./b.js";
|
|
import { c } from "./c.jsx";
|
|
b; c;`,
|
|
})
|
|
}
|