Use expect's instanceOf and toHaveProperty methods
This commit is contained in:
@@ -12,8 +12,8 @@ expect(C.b()).toBe('B.b');
|
||||
|
||||
class D extends Object {}
|
||||
|
||||
expect(D instanceof Object).toBeTruthy();
|
||||
expect(D.prototype instanceof Object).toBeTruthy();
|
||||
expect(D).toBeInstanceOf(Object);
|
||||
expect(D.prototype).toBeInstanceOf(Object);
|
||||
expect(D.keys).toBe(Object.keys);
|
||||
|
||||
class E {}
|
||||
|
||||
@@ -5,5 +5,5 @@ class Foo {
|
||||
}
|
||||
|
||||
const f = new Foo;
|
||||
expect(f instanceof Foo).toBeTruthy();
|
||||
expect(f).toBeInstanceOf(Foo);
|
||||
expect(typeof f).toBe("object");
|
||||
|
||||
Reference in New Issue
Block a user