bahmutov / cy-spok

Playing with spok inside Cypress

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot chain spoks

bahmutov opened this issue · comments

This works (single spok with 2 items)

it('spoks several times', () => {
  const o = {
    one: 1,
    two: 2,
    three: 3,
  }
  cy.wrap(o).should(spok({ one: 1, two: 2 }))
})

Screen Shot 2019-12-16 at 4 32 12 PM

but adding another assertion there breaks things

it('spoks several times', () => {
  const o = {
    one: 1,
    two: 2,
    three: 3,
  }
  cy.wrap(o)
    .should(spok({ one: 1, two: 2 }))
    .and(spok({ two: 2 }))
})

Screen Shot 2019-12-16 at 4 48 03 PM

Fixed in cypress-io/cypress#6128 and released Cypress 3.8.2. Now you can chain spoks.

nice @sainthkh - it is working now, perfect.