Skip to content

Commit bfff6ef

Browse files
Copilotjakebailey
andcommitted
Add test for destructured interface JSDoc comments
Co-authored-by: jakebailey <[email protected]>
1 parent de2f333 commit bfff6ef

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
package fourslash_test
2+
3+
import (
4+
"testing"
5+
6+
"github.com/microsoft/typescript-go/internal/fourslash"
7+
"github.com/microsoft/typescript-go/internal/testutil"
8+
)
9+
10+
func TestDestructuredInterfaceJSDoc(t *testing.T) {
11+
t.Parallel()
12+
defer testutil.RecoverAndFail(t, "Panic on fourslash test")
13+
const content = `
14+
interface FooBar {
15+
/** foo comment */
16+
foo: number;
17+
/** bar comment */
18+
bar: string;
19+
/** baz comment */
20+
baz: string;
21+
}
22+
23+
declare const fubar: FooBar;
24+
25+
const {/*1*/foo, /*2*/bar, /*3*/baz} = fubar;
26+
`
27+
f, done := fourslash.NewFourslash(t, nil /*capabilities*/, content)
28+
defer done()
29+
f.VerifyQuickInfoAt(t, "1", "const foo: number", "foo comment")
30+
f.VerifyQuickInfoAt(t, "2", "const bar: string", "bar comment")
31+
f.VerifyQuickInfoAt(t, "3", "const baz: string", "baz comment")
32+
}

0 commit comments

Comments
 (0)