mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-24 10:22:05 -05:00
16 lines
387 B
JavaScript
16 lines
387 B
JavaScript
test("basic functionality", () => {
|
|
expect(typeof this).toBe("object");
|
|
expect(this).toBe(globalThis);
|
|
});
|
|
|
|
test("this inside instantiated functions is not globalThis", () => {
|
|
let functionThis;
|
|
function Foo() {
|
|
this.x = 5;
|
|
functionThis = this;
|
|
}
|
|
|
|
new Foo();
|
|
expect(typeof functionThis).toBe("object");
|
|
expect(functionThis.x).toBe(5);
|
|
});
|