phongnd39 / cypress-jest-adapter

Add jest assertion style to Cypress expect command
MIT License
93 stars 6 forks source link

How to support should common assertions? #9

Open JimmyLv opened 5 years ago

JimmyLv commented 5 years ago

describe('page', () => {
  it('should allow should(string) style matching from jest', () => {
    cy.wrap(5).should('toBe', 5)
    cy.wrap({ foo: 'bar' }).should('toHaveProperty', 'foo', 'bar')
  })
})

ref: [Using Jest matchers in Cypress - Nicholas Boll - Medium] https://medium.com/@NicholasBoll/using-jest-matchers-in-cypress-5e8e7281f5dd