summaryrefslogtreecommitdiff
path: root/Libraries/LibJS/Tests/functions/constructor-basic.js
blob: cf5852563411c58f159cc03fbacd808efe46864d (plain)
1
2
3
4
5
6
7
8
9
10
11
test("basic functionality", () => {
    function Foo() {
        this.x = 123;
    }

    expect(Foo.prototype.constructor).toBe(Foo);

    const foo = new Foo();
    expect(foo.constructor).toBe(Foo);
    expect(foo.x).toBe(123);
});