1.0.1 • Published 5 years ago

@rckeller/cypress-unfetch v1.0.1

Weekly downloads
5,606
License
MIT
Repository
-
Last release
5 years ago

@rckeller/cypress-react

Unofficial Cypress utilities for tracking network state

npm i -D @rckeller/cypress-unfetch

Configuration

These utilities automatically configure your cypress instance upon import.

// support/index.js
import '@rckeller/cypress-unfetch'

We recommmend setting up the optional cy.await command, which tracks in-flight requests in the background. You can use this to wait for network state to resolve before progressing to a new test run.

// support/index.js
import '@rckeller/cypress-unfetch/await'

// You can add an afterEach to this file, which becomes "global"
afterEach(() => {
  cy.await()
})

Registering cy.await starts a server in the background, which can be used to track and block specific routes like so.

// in support/index.js OR a test
beforeEach(() => {
  cy.route('/api/**').as('API')
})

test('something', () => {
  cy.log('before...')
    .wait('@API')
    .log('...after')
})
1.0.1

5 years ago

1.0.0

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago