libs/mocha/should.js
function(name, val, desc){
        if (this.negate && undefined !== val) {
            if (undefined === this.obj[name]) {
                throw new Error(this.inspect + ' has no property ' + i(name) + (desc ? " | " + desc : ""));
            }
        } else {
            this.assert(
                undefined !== this.obj[name]
                , function(){ return 'expected ' + this.inspect + ' to have a property ' + i(name) + (desc ? " | " + desc : "") }
                , function(){ return 'expected ' + this.inspect + ' to not have a property ' + i(name) + (desc ? " | " + desc : "") });
        }

        if (undefined !== val) {
            this.assert(
                val === this.obj[name]
                , function(){ return 'expected ' + this.inspect + ' to have a property ' + i(name)
                    + ' of ' + i(val) + ', but got ' + i(this.obj[name]) + (desc ? " | " + desc : "") }
                , function(){ return 'expected ' + this.inspect + ' to not have a property ' + i(name) + ' of ' + i(val) + (desc ? " | " + desc : "") });
        }

        this.obj = this.obj[name];
        return this;
    }
function(name, val, desc){
        if (this.negate && undefined !== val) {
            if (undefined === this.obj[name]) {
                throw new Error(this.inspect + ' has no property ' + i(name) + (desc ? " | " + desc : ""));
            }
        } else {
            this.assert(
                undefined !== this.obj[name]
                , function(){ return 'expected ' + this.inspect + ' to have a property ' + i(name) + (desc ? " | " + desc : "") }
                , function(){ return 'expected ' + this.inspect + ' to not have a property ' + i(name) + (desc ? " | " + desc : "") });
        }

        if (undefined !== val) {
            this.assert(
                val === this.obj[name]
                , function(){ return 'expected ' + this.inspect + ' to have a property ' + i(name)
                    + ' of ' + i(val) + ', but got ' + i(this.obj[name]) + (desc ? " | " + desc : "") }
                , function(){ return 'expected ' + this.inspect + ' to not have a property ' + i(name) + ' of ' + i(val) + (desc ? " | " + desc : "") });
        }

        this.obj = this.obj[name];
        return this;
    }
function ( name , val , desc ) { if ( this . negate && undefined !== val ) { if ( undefined === this . obj [ name ] ) { throw new Error ( this . inspect + ' has no property ' + i ( name ) + ( desc ? " | " + desc : "" ) ) ; } } else { this . assert ( undefined !== this . obj [ name ] , function ( ) { return 'expected ' + this . inspect + ' to have a property ' + i ( name ) + ( desc ? " | " + desc : "" ) } , function ( ) { return 'expected ' + this . inspect + ' to not have a property ' + i ( name ) + ( desc ? " | " + desc : "" ) } ) ; } if ( undefined !== val ) { this . assert ( val === this . obj [ name ] , function ( ) { return 'expected ' + this . inspect + ' to have a property ' + i ( name ) + ' of ' + i ( val ) + ', but got ' + i ( this . obj [ name ] ) + ( desc ? " | " + desc : "" ) } , function ( ) { return 'expected ' + this . inspect + ' to not have a property ' + i ( name ) + ' of ' + i ( val ) + ( desc ? " | " + desc : "" ) } ) ; } this . obj = this . obj [ name ] ; return this ; }
Assert property _name_ exists, with optional _val_.

@param {String} name
@param {Mixed} [val]
@param {String} description
@api public
Assert property _name_ exists with optional _val_ .