Skip to content

Instantly share code, notes, and snippets.

@ThaddeusJiang
Created May 9, 2019 10:32
Show Gist options
  • Save ThaddeusJiang/6a791d4a5e64f27f3f4b55d8a2987262 to your computer and use it in GitHub Desktop.
Save ThaddeusJiang/6a791d4a5e64f27f3f4b55d8a2987262 to your computer and use it in GitHub Desktop.
Cypress memo

Cypress Memo

Cypress is a testing tool, can test anything that runs in a browser.

  • End-to-end tests
  • Integration tests
  • Unit tests

Summary

  1. Set up tests
  2. Write tests
  3. Run tests
  4. Debug tests

Set up tests

$ cd /your/product/path
$ yarn add cypress --dev

Write tests

  1. Create a sample_spec.js file in the cypress/integration folder.

  2. Write tests

describe('My First Test', function() {
  it('Does not do much!', function() {
    expect(true).to.equal(true)
  })
})

Run tests

yarn cypress open

Debug tests

Same with chrome.

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