1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-15 07:44:58 +00:00
serenity/Userland/Libraries/LibJS/Tests/custom-@@hasInstance.js
2021-01-12 12:17:46 +01:00

9 lines
230 B
JavaScript

test("basic functionality", () => {
function Foo() {}
Foo[Symbol.hasInstance] = value => {
return value === 2;
};
expect(new Foo() instanceof Foo).toBeFalse();
expect(2 instanceof Foo).toBeTrue();
});