Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cypress-network-idle

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cypress-network-idle - npm Package Compare versions

Comparing version 1.7.0 to 1.8.0

4

package.json
{
"name": "cypress-network-idle",
"version": "1.7.0",
"version": "1.8.0",
"description": "A little Cypress.io plugin for waiting for network to be idle before continuing with the test",

@@ -34,3 +34,3 @@ "main": "src/index.js",

"devDependencies": {
"cypress": "9.6.1",
"cypress": "9.7.0",
"micro": "^9.3.4",

@@ -37,0 +37,0 @@ "micro-dev": "^3.0.0",

@@ -1,2 +0,2 @@

# cypress-network-idle ![cypress version](https://img.shields.io/badge/cypress-9.6.1-brightgreen) [![renovate-app badge][renovate-badge]][renovate-app] [![ci](https://github.com/bahmutov/cypress-network-idle/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/bahmutov/cypress-network-idle/actions/workflows/ci.yml)
# cypress-network-idle ![cypress version](https://img.shields.io/badge/cypress-9.7.0-brightgreen) [![renovate-app badge][renovate-badge]][renovate-app] [![ci](https://github.com/bahmutov/cypress-network-idle/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/bahmutov/cypress-network-idle/actions/workflows/ci.yml)

@@ -3,0 +3,0 @@ > A little Cypress.io plugin for waiting for network to be idle before continuing with the test

/// <reference types="cypress" />
const logPrefix = '**network-idle**'
function waitForIdle(counters, timeLimitMs, timeout, interval) {

@@ -7,4 +9,4 @@ counters.started = +new Date()

cy.log(`network idle for ${timeLimitMs} ms (timeout: ${timeout} ms)`)
cy.wrap('waiting...', { timeout }).should(check)
cy.log(`${logPrefix} for ${timeLimitMs} ms (timeout: ${timeout} ms)`)
cy.wrap(`${logPrefix} waiting...`, { timeout }).should(check)

@@ -18,3 +20,3 @@ function check() {

if (elapsed > timeLimitMs && !counters.currentCallCount) {
cy.log(`finished after ${waited} ms`)
cy.log(`${logPrefix} finished after ${waited} ms`)
cy.wrap(

@@ -29,7 +31,7 @@ {

)
return;
return
}
if (waited > timeout) {
throw new Error(`Network is busy. Failed after ${waited} ms`)
throw new Error(`Network is busy. Failed after ${waited} ms`)
}

@@ -41,3 +43,9 @@

function waitForNetworkIdleImpl({ method, pattern, timeLimitMs, timeout, interval }) {
function waitForNetworkIdleImpl({
method,
pattern,
timeLimitMs,
timeout,
interval,
}) {
const counters = {

@@ -44,0 +52,0 @@ callCount: 0,

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc