46 lines
1.3 KiB
Go
46 lines
1.3 KiB
Go
// Code generated by convertFourslash; DO NOT EDIT.
|
|
// To modify this test, run "npm run makemanual codeFixClassImplementInterfaceWithAmbientSignatures1"
|
|
|
|
package fourslash_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/microsoft/typescript-go/internal/fourslash"
|
|
"github.com/microsoft/typescript-go/internal/testutil"
|
|
)
|
|
|
|
func TestCodeFixClassImplementInterfaceWithAmbientSignatures1(t *testing.T) {
|
|
fourslash.SkipIfFailing(t)
|
|
t.Parallel()
|
|
defer testutil.RecoverAndFail(t, "Panic on fourslash test")
|
|
const content = `// @lib: esnext
|
|
// @target: esnext
|
|
// @Filename: /node_modules/@types/node/globals.d.ts
|
|
export {};
|
|
declare global {
|
|
interface SymbolConstructor {
|
|
readonly dispose: unique symbol;
|
|
}
|
|
interface Disposable {
|
|
[Symbol.dispose](): void;
|
|
}
|
|
}
|
|
// @Filename: /node_modules/@types/node/index.d.ts
|
|
/// <reference path="globals.d.ts" />
|
|
// @Filename: a.ts
|
|
class Foo implements Disposable {}`
|
|
f, done := fourslash.NewFourslash(t, nil /*capabilities*/, content)
|
|
defer done()
|
|
f.GoToFile(t, "a.ts")
|
|
f.VerifyCodeFix(t, fourslash.VerifyCodeFixOptions{
|
|
Description: "Implement interface 'Disposable'",
|
|
NewFileContent: `class Foo implements Disposable {
|
|
[Symbol.dispose](): void {
|
|
throw new Error("Method not implemented.");
|
|
}
|
|
}`,
|
|
Index: 0,
|
|
})
|
|
}
|