Skip to content

Commit f68399b

Browse files
committed
fixed expects and add extra tests
1 parent f2e2be5 commit f68399b

File tree

3 files changed

+182
-3
lines changed

3 files changed

+182
-3
lines changed

tests/cases/fourslash/navigationBarExportAssignment1.ts renamed to tests/cases/fourslash/navigationItemsExportDefaultExpression2.ts

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,13 @@
2525
//// export default (class {
2626
//// prop = 42;
2727
//// });
28+
////
29+
//// export default (class Cls {
30+
//// prop = 42;
31+
//// });
2832

2933
verify.navigationTree({
30-
text: '"navigationBarExportAssignment1"',
34+
text: '"navigationItemsExportDefaultExpression2"',
3135
kind: "module",
3236
childItems: [
3337
{
@@ -91,6 +95,23 @@ verify.navigationTree({
9195
},
9296
],
9397
},
98+
{
99+
text: "default",
100+
kind: "const",
101+
kindModifiers: "export",
102+
childItems: [
103+
{
104+
text: "Cls",
105+
kind: "class",
106+
childItems: [
107+
{
108+
text: "prop",
109+
kind: "property",
110+
},
111+
],
112+
},
113+
],
114+
},
94115
{
95116
text: "foo",
96117
kind: "const",

tests/cases/fourslash/navigationItemsExportEqualsExpression.ts

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@
2929
//// d: 1
3030
//// }
3131
//// }
32+
////
33+
//// function foo(props: { x: number; y: number }) {}
34+
//// export = foo({ x: 1, y: 1 });
3235

3336
verify.navigationTree({
3437
"text": '"navigationItemsExportEqualsExpression"',
@@ -85,7 +88,13 @@ verify.navigationTree({
8588
{
8689
"text": "export=",
8790
"kind": "class",
88-
"kindModifiers": "export"
91+
"kindModifiers": "export",
92+
"childItems": [
93+
{
94+
"text": "AB",
95+
"kind": "class"
96+
}
97+
]
8998
},
9099
{
91100
"text": "export=",
@@ -112,6 +121,21 @@ verify.navigationTree({
112121
}
113122
]
114123
},
124+
{
125+
"text": "export=",
126+
"kind": "const",
127+
"kindModifiers": "export",
128+
"childItems": [
129+
{
130+
"text": "x",
131+
"kind": "property"
132+
},
133+
{
134+
"text": "y",
135+
"kind": "property"
136+
}
137+
]
138+
},
115139
{
116140
"text": "abc",
117141
"kind": "const"
@@ -120,7 +144,10 @@ verify.navigationTree({
120144
"text": "export=",
121145
"kind": "const",
122146
"kindModifiers": "export"
147+
},
148+
{
149+
"text": "foo",
150+
"kind": "function"
123151
}
124152
]
125153
});
126-
Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
/// <reference path="fourslash.ts"/>
2+
3+
//// export const foo = {
4+
//// foo: {},
5+
//// };
6+
////
7+
//// export = {
8+
//// foo: {},
9+
//// };
10+
////
11+
//// export = {
12+
//// foo: {},
13+
//// };
14+
////
15+
//// type Type = typeof foo;
16+
////
17+
//// export = {
18+
//// foo: {},
19+
//// } as Type;
20+
////
21+
//// export = {
22+
//// foo: {},
23+
//// } satisfies Type;
24+
////
25+
//// export = (class {
26+
//// prop = 42;
27+
//// });
28+
////
29+
//// export = (class Cls {
30+
//// prop = 42;
31+
//// });
32+
33+
verify.navigationTree({
34+
text: '"navigationItemsExportEqualsExpression2"',
35+
kind: "module",
36+
childItems: [
37+
{
38+
text: "export=",
39+
kind: "const",
40+
kindModifiers: "export",
41+
childItems: [
42+
{
43+
text: "foo",
44+
kind: "property",
45+
},
46+
],
47+
},
48+
{
49+
text: "export=",
50+
kind: "const",
51+
kindModifiers: "export",
52+
childItems: [
53+
{
54+
text: "foo",
55+
kind: "property",
56+
},
57+
],
58+
},
59+
{
60+
text: "export=",
61+
kind: "const",
62+
kindModifiers: "export",
63+
childItems: [
64+
{
65+
text: "foo",
66+
kind: "property",
67+
},
68+
],
69+
},
70+
{
71+
text: "export=",
72+
kind: "const",
73+
kindModifiers: "export",
74+
childItems: [
75+
{
76+
text: "foo",
77+
kind: "property",
78+
},
79+
],
80+
},
81+
{
82+
text: "export=",
83+
kind: "const",
84+
kindModifiers: "export",
85+
childItems: [
86+
{
87+
text: "<class>",
88+
kind: "class",
89+
childItems: [
90+
{
91+
text: "prop",
92+
kind: "property",
93+
},
94+
],
95+
},
96+
],
97+
},
98+
{
99+
text: "export=",
100+
kind: "const",
101+
kindModifiers: "export",
102+
childItems: [
103+
{
104+
text: "Cls",
105+
kind: "class",
106+
childItems: [
107+
{
108+
text: "prop",
109+
kind: "property",
110+
},
111+
],
112+
},
113+
],
114+
},
115+
{
116+
text: "foo",
117+
kind: "const",
118+
kindModifiers: "export",
119+
childItems: [
120+
{
121+
text: "foo",
122+
kind: "property",
123+
},
124+
],
125+
},
126+
{
127+
text: "Type",
128+
kind: "type",
129+
},
130+
],
131+
});

0 commit comments

Comments
 (0)