mirror of
https://github.com/cypress-io/cypress.git
synced 2026-02-21 14:41:00 -06:00
822 B
822 B
title: wrap comments: 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