kittenipc/kitcom/internal/tsgo/fourslash/tests/gen/renameFromNodeModulesDep4_test.go
2025-10-15 10:12:44 +03:00

41 lines
1.3 KiB
Go

package fourslash_test
import (
"testing"
"efprojects.com/kitten-ipc/kitcom/internal/tsgo/fourslash"
"efprojects.com/kitten-ipc/kitcom/internal/tsgo/testutil"
)
func TestRenameFromNodeModulesDep4(t *testing.T) {
t.Parallel()
t.Skip()
defer testutil.RecoverAndFail(t, "Panic on fourslash test")
const content = `// @Filename: /index.ts
import hljs from "highlight.js/lib/core"
import { h } from "highlight.js/lib/core";
import { /*notOk*/h as hh } from "highlight.js/lib/core";
/*ok*/[|hljs|];
/*okWithAlias*/[|h|];
/*ok2*/[|hh|];
// @Filename: /node_modules/highlight.js/lib/core.d.ts
declare const hljs: { registerLanguage(s: string): void };
export default hljs;
export const h: string;
// @Filename: /tsconfig.json
{}`
f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
f.GoToMarker(t, "ok")
f.VerifyRenameSucceeded(t, nil /*preferences*/)
f.VerifyRenameSucceeded(t, nil /*preferences*/)
f.GoToMarker(t, "ok2")
f.VerifyRenameSucceeded(t, nil /*preferences*/)
f.VerifyRenameSucceeded(t, nil /*preferences*/)
f.GoToMarker(t, "notOk")
f.VerifyRenameFailed(t, nil /*preferences*/)
f.VerifyRenameFailed(t, nil /*preferences*/)
f.GoToMarker(t, "okWithAlias")
f.VerifyRenameSucceeded(t, nil /*preferences*/)
f.VerifyRenameFailed(t, nil /*preferences*/)
}