mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 19:38:12 +00:00
LibJS: Convert remaining top-level tests to new system
This commit is contained in:
parent
6d58c48c2f
commit
918f4affd5
19 changed files with 518 additions and 497 deletions
16
Libraries/LibJS/Tests/const-reassignment.js
Normal file
16
Libraries/LibJS/Tests/const-reassignment.js
Normal file
|
@ -0,0 +1,16 @@
|
|||
test.skip("reassignment to const", () => {
|
||||
const constantValue = 1;
|
||||
expect(() => {
|
||||
constantValue = 2;
|
||||
}).toThrowWithMessage(TypeError, "Invalid assignment to const variable");
|
||||
expect(constantValue).toBe(1);
|
||||
});
|
||||
|
||||
test("const creation in inner scope", () => {
|
||||
const constantValue = 1;
|
||||
do {
|
||||
const constantValue = 2;
|
||||
expect(constantValue).toBe(2);
|
||||
} while (false);
|
||||
expect(constantValue).toBe(1);
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue