mirror of
https://github.com/RGBCube/serenity
synced 2025-10-15 16:22:23 +00:00
test-js: Use prettier and format all files
This commit is contained in:
parent
e532888242
commit
6d58c48c2f
248 changed files with 8291 additions and 7725 deletions
|
@ -1,25 +1,27 @@
|
|||
load("test-common.js");
|
||||
|
||||
try {
|
||||
const constantValue = 1;
|
||||
assertThrowsError(
|
||||
() => {
|
||||
constantValue = 2;
|
||||
},
|
||||
{
|
||||
error: TypeError,
|
||||
message: "Invalid assignment to const variable",
|
||||
}
|
||||
);
|
||||
assert(constantValue === 1);
|
||||
|
||||
const constantValue = 1;
|
||||
assertThrowsError(() => {
|
||||
constantValue = 2;
|
||||
}, {
|
||||
error: TypeError,
|
||||
message: "Invalid assignment to const variable"
|
||||
});
|
||||
assert(constantValue === 1);
|
||||
// Make sure we can define new constants in inner scopes.
|
||||
const constantValue2 = 1;
|
||||
do {
|
||||
const constantValue2 = 2;
|
||||
assert(constantValue2 === 2);
|
||||
} while (false);
|
||||
assert(constantValue2 === 1);
|
||||
|
||||
// Make sure we can define new constants in inner scopes.
|
||||
const constantValue2 = 1;
|
||||
do {
|
||||
const constantValue2 = 2;
|
||||
assert(constantValue2 === 2);
|
||||
} while (false);
|
||||
assert(constantValue2 === 1);
|
||||
|
||||
console.log("PASS");
|
||||
console.log("PASS");
|
||||
} catch (e) {
|
||||
console.log("FAIL: " + e);
|
||||
console.log("FAIL: " + e);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue