1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-15 07:04:59 +00:00
serenity/Libraries/LibJS/Tests/with-basic.js
Linus Groh 5122f98198 Base+LibJS+LibWeb: Make prettier clean
Also use "// prettier-ignore" comments where necessary rather than
excluding whole files (via .prettierignore).
2020-12-27 21:25:27 +01:00

24 lines
508 B
JavaScript

test("basic with statement functionality", () => {
var object = { foo: 5, bar: 6, baz: 7 };
var qux = 1;
var bar = 99;
with (object) {
expect(foo).toBe(5);
expect(bar).toBe(6);
expect(baz).toBe(7);
expect(qux).toBe(1);
expect(typeof quz).toBe("undefined");
bar = 2;
}
expect(object.bar).toBe(2);
expect(bar).toBe(99);
});
test("syntax error in strict mode", () => {
expect("'use strict'; with (foo) {}").not.toEval();
});