[@types/chai] Add 'own' type definition (#38083)

* Add 'own' type definition

* add 'own' tests
This commit is contained in:
Raúl Acuña
2019-09-03 20:30:15 -04:00
committed by Ron Buckton
parent ae863e389d
commit 3225ded66b
2 changed files with 14 additions and 0 deletions

View File

@@ -608,6 +608,13 @@ function nestedProperty2() {
.not.have.nested.property('foo.bar', 'baz', 'blah');
}
function own() {
expect('test').to.have.own.property('length');
expect('test').to.own.property('length');
expect({ length: 12 }).to.have.own.property('length');
expect({ length: 12 }).to.not.have.own.property('length', 'blah');
}
function ownProperty() {
expect('test').to.have.ownProperty('length');
'test'.should.have.ownProperty('length');

View File

@@ -179,6 +179,7 @@ declare namespace Chai {
deep: Deep;
ordered: Ordered;
nested: Nested;
own: Own;
any: KeyFilter;
all: KeyFilter;
a: TypeComparison;
@@ -294,6 +295,11 @@ declare namespace Chai {
members: Members;
}
interface Own {
include: Include;
property: Property;
}
interface Deep {
equal: Equal;
equals: Equal;
@@ -303,6 +309,7 @@ declare namespace Chai {
members: Members;
ordered: Ordered;
nested: Nested;
own: Own;
}
interface Ordered {