Use expect's instanceOf and toHaveProperty methods

This commit is contained in:
Deven Bansod
2018-03-27 21:59:38 +05:30
parent c9b99af5a6
commit b09c729675
51 changed files with 101 additions and 124 deletions

View File

@@ -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 {}

View File

@@ -5,5 +5,5 @@ class Foo {
}
const f = new Foo;
expect(f instanceof Foo).toBeTruthy();
expect(f).toBeInstanceOf(Foo);
expect(typeof f).toBe("object");