Files
cypress/docs/source/api/commands/wrap.md
T
2017-05-23 17:17:27 -04:00

835 B

title, comments, description
title comments description
wrap true

Return the object passed into cy.wrap.

Returns the object passed into cy.wrap
Timeout cannot timeout

cy.wrap( object )

Return the object passed into cy.wrap.

Options

Pass in an options object to change the default behavior of cy.wrap.

cy.wrap( object, options )

Option Default Notes
log true whether to display command in command log

Usage

Invokes the function on the subject in wrap and returns the new value.

var fn = function(){
  return 'bar'
}

cy.wrap({foo: fn}).invoke('foo').should('eq', 'bar') // true

See also