X Tutup
Skip to content

Commit 9172e88

Browse files
fix: test do not pollute parent scope
1 parent 741db69 commit 9172e88

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/unit/switch.spec.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,3 +360,15 @@ test("switch fallthrough stops after default", () => {
360360
return out;
361361
`.expectToMatchJsResult();
362362
});
363+
364+
test("switch does not pollute parent scope", () => {
365+
util.testFunction`
366+
let x: number = 0;
367+
let y = 1;
368+
switch (x) {
369+
case 0:
370+
let y = 2;
371+
}
372+
return y;
373+
`.expectToMatchJsResult();
374+
});

0 commit comments

Comments
 (0)
X Tutup