@xano/xanoscript-language-server 11.6.2 → 11.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -20,6 +20,18 @@ describe("tryCatchFn", () => {
|
|
|
20
20
|
expect(parser.errors).to.be.empty;
|
|
21
21
|
});
|
|
22
22
|
|
|
23
|
+
it("tryCatchFn only try is required, catch and finally are optional", () => {
|
|
24
|
+
const parser = parse(`try_catch {
|
|
25
|
+
try {
|
|
26
|
+
var $x1 {
|
|
27
|
+
value = "try"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}`);
|
|
31
|
+
expect(parser.errors).to.be.empty;
|
|
32
|
+
expect(parser.warnings).to.not.be.empty;
|
|
33
|
+
});
|
|
34
|
+
|
|
23
35
|
it("tryCatchFn try and catch can contain a stack", () => {
|
|
24
36
|
const parser = parse(`try_catch {
|
|
25
37
|
try {
|
|
@@ -166,7 +178,7 @@ describe("tryCatchFn", () => {
|
|
|
166
178
|
expect(parser.errors).to.not.be.empty;
|
|
167
179
|
});
|
|
168
180
|
|
|
169
|
-
it("tryCatchFn
|
|
181
|
+
it("tryCatchFn warns when catch block is missing", () => {
|
|
170
182
|
const parser = parse(`try_catch {
|
|
171
183
|
try {
|
|
172
184
|
var $x1 {
|
|
@@ -174,6 +186,8 @@ describe("tryCatchFn", () => {
|
|
|
174
186
|
}
|
|
175
187
|
}
|
|
176
188
|
}`);
|
|
177
|
-
expect(parser.errors).to.
|
|
189
|
+
expect(parser.errors).to.be.empty;
|
|
190
|
+
expect(parser.warnings).to.not.be.empty;
|
|
191
|
+
expect(parser.warnings[0].message).to.include("catch");
|
|
178
192
|
});
|
|
179
193
|
});
|