mirror of
https://github.com/RGBCube/serenity
synced 2025-05-28 10:55:06 +00:00
parent
2c888b3c6e
commit
8f54edb7a0
2 changed files with 22 additions and 4 deletions
|
@ -36,4 +36,17 @@ describe("basic switch tests", () => {
|
|||
|
||||
expect().fail();
|
||||
});
|
||||
|
||||
test("return from switch statement", () => {
|
||||
function foo(value) {
|
||||
switch (value) {
|
||||
case 42:
|
||||
return "return from 'case 42'";
|
||||
default:
|
||||
return "return from 'default'";
|
||||
}
|
||||
}
|
||||
expect(foo(42)).toBe("return from 'case 42'");
|
||||
expect(foo(43)).toBe("return from 'default'");
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue