@nevware21/tripwire - v0.1.8
    Preparing search index...

    Interface IHasOwnOp<R>

    The own operation reached through has (expect(value).has.own): every assertion of IOwnOp, which checks the object's own properties and never its prototype chain, plus the has assertions that make sense against own properties alone - all, any, nested, lengthOf and sizeOf.

    0.2.0

    interface IHasOwnOp<R> {
        all: IAllOp<R>;
        any: IAnyOp<R>;
        contain: IIncludeOp<R>;
        contains: IIncludeOp<R>;
        include: IIncludeOp<R>;
        includes: IIncludeOp<R>;
        iterator: SymbolFn;
        lengthOf(length: number, evalMsg?: MsgSource): R;
        nested: INestedOp<R>;
        property: PropertyFn;
        propertyDescriptor: PropertyDescriptorFn;
        sizeOf(size: number, evalMsg?: MsgSource): R;
    }

    Type Parameters

    • R

      The type of the result of the operation.

    Hierarchy (View Summary)

    Index
    all: IAllOp<R>

    Provides the all assertion operations over the object's own keys.

    expect({ a: 1, b: 2 }).has.own.all.keys('a', 'b');
    
    any: IAnyOp<R>

    Provides the any assertion operations over the object's own keys.

    expect({ a: 1, b: 2 }).has.own.any.keys('a', 'c');
    
    contain: IIncludeOp<R>

    A property assertion that validates the existence of a property on an object.

    The name of the property to validate.

    contains: IIncludeOp<R>

    A property assertion that validates the existence of a property on an object.

    The name of the property to validate.

    include: IIncludeOp<R>

    A property assertion that validates the existence of a property on an object.

    The name of the property to validate.

    includes: IIncludeOp<R>

    A property assertion that validates the existence of a property on an object.

    The name of the property to validate.

    iterator: SymbolFn

    Asserts that the object has the Symbol.iterator property.

    expect({ [Symbol.iterator]: () => {} }).has.iterator();
    
    nested: INestedOp<R>

    Provides the nested assertion operations.

    expect({ a: { b: 1 } }).has.own.nested.property('a.b');
    
    property: PropertyFn

    A property assertion that validates the existence of a property on an object.

    The name of the property to validate.

    propertyDescriptor: PropertyDescriptorFn

    A property assertion that validates the existence of a property descriptor on an object.

    The name of the property to validate.

    • Asserts that the target has a length or size property equal to the given number. Works with arrays, strings, Maps, Sets, and any object with a length or size property.

      Parameters

      • length: number

        The expected length or size.

      • OptionalevalMsg: MsgSource

        Optional error message.

      Returns R

      expect([1, 2, 3]).has.own.lengthOf(3);
      
    • Asserts that the target has a size or length property equal to the given number. Works with arrays, strings, Maps, Sets, and any object with a length or size property.

      Parameters

      • size: number

        The expected size or length.

      • OptionalevalMsg: MsgSource

        Optional error message.

      Returns R

      expect(new Set([1, 2])).has.own.sizeOf(2);