Skip to content

Conversation

@mosofsky
Copy link

Added examples for toMatchSnapshot() to illustrate cy.wrap() and cy.readFile():

  it('toMatchSnapshot - object of type any using cy.wrap()', () => {
    const actualString = "this is an exmample of string data you want to match to a snapshot";
    cy.wrap(actualString).toMatchSnapshot();

    const actualObject = { name: 'Jane Lane' };
    cy.wrap(actualObject).toMatchSnapshot();
  });

  it('toMatchSnapshot - readFile', () => {
    cy.readFile('menu.json').toMatchSnapshot();
  });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant