Files
kjol/tools/tsgo/internal/fourslash/tests/gen/codeFixClassImplementInterfaceGlobal_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 codeFixClassImplementInterfaceGlobal"
package fourslash_test
import (
"testing"
"github.com/microsoft/typescript-go/internal/fourslash"
"github.com/microsoft/typescript-go/internal/testutil"
)
func TestCodeFixClassImplementInterfaceGlobal(t *testing.T) {
fourslash.SkipIfFailing(t)
t.Parallel()
defer testutil.RecoverAndFail(t, "Panic on fourslash test")
const content = `// @Filename: /src/globals.d.ts
export {}; // Make this a module
declare global {
interface Disposable {
[Symbol.dispose](): void;
}
}
// @Filename: /src/test.ts
import { Service } from './lifecycle';
export class [|EditingService|] implements Service { }
// @Filename: /src/lifecycle.ts
export interface Disposable {
(): string;
}
export interface Service {
d: Disposable;
}`
f, done := fourslash.NewFourslash(t, nil /*capabilities*/, content)
defer done()
f.GoToFile(t, "/src/test.ts")
f.VerifyCodeFix(t, fourslash.VerifyCodeFixOptions{
Description: "Implement interface 'Service'",
NewFileContent: `import { Disposable, Service } from './lifecycle';
export class EditingService implements Service {
d: Disposable;
}`,
Index: 0,
})
}