bahmutov/cypress-map

Grab the subject from the cy chain without return in cy.mapChain command

bahmutov opened this issue ยท 1 comments

Works

it('maps each item to the cy yielded value of the returned chain', () => {
  cy.wrap([1, 2, 3])
    .mapChain((x) => cy.wrap(x).then(doubleIt))
    .should('deep.equal', [2, 4, 6])
})

does not work without a return

cy.wrap([1, 2, 3])
  .mapChain((x) => {
    // do not return the command chain
    // but it still should grab the resolved value
    cy.wrap(x).then(doubleIt)
  })
  .should('deep.equal', [2, 4, 6])

๐ŸŽ‰ This issue has been resolved in version 1.13.1 ๐ŸŽ‰

The release is available on:

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€