@@ -0,0 +1,8 @@
+test("basic functionality", () => {
+ expect(Function.prototype[Symbol.hasInstance]).toHaveLength(1);
+
+ function Foo() {}
+ const foo = new Foo();
+ expect(Function.prototype[Symbol.hasInstance].call(Foo, foo)).toBeTrue();
+});
@@ -0,0 +1,9 @@
+ Foo[Symbol.hasInstance] = value => {
+ return value === 2;
+ };
+ expect(new Foo() instanceof Foo).toBeFalse();
+ expect(2 instanceof Foo).toBeTrue();