mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
39 lines
1.1 KiB
Go
39 lines
1.1 KiB
Go
// Code generated by convertFourslash; DO NOT EDIT.
|
|
// To modify this test, run "npm run makemanual importNameCodeFix_avoidRelativeNodeModules"
|
|
|
|
package fourslash_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/microsoft/typescript-go/internal/fourslash"
|
|
"github.com/microsoft/typescript-go/internal/testutil"
|
|
)
|
|
|
|
func TestImportNameCodeFix_avoidRelativeNodeModules(t *testing.T) {
|
|
fourslash.SkipIfFailing(t)
|
|
t.Parallel()
|
|
defer testutil.RecoverAndFail(t, "Panic on fourslash test")
|
|
const content = `// @Filename: /a/index.d.ts
|
|
// @Symlink: /b/node_modules/a/index.d.ts
|
|
// @Symlink: /c/node_modules/a/index.d.ts
|
|
export const a: number;
|
|
// @Filename: /b/index.ts
|
|
// @Symlink: /c/node_modules/b/index.d.ts
|
|
import { a } from 'a'
|
|
export const b: number;
|
|
// @Filename: /c/a_user.ts
|
|
import { a } from "a";
|
|
// @Filename: /c/foo.ts
|
|
[|import { b } from "b";
|
|
a;|]`
|
|
f, done := fourslash.NewFourslash(t, nil /*capabilities*/, content)
|
|
defer done()
|
|
f.GoToFile(t, "/c/foo.ts")
|
|
f.VerifyImportFixAtPosition(t, []string{
|
|
`import { a } from "a";
|
|
import { b } from "b";
|
|
a;`,
|
|
}, nil /*preferences*/)
|
|
}
|