{"id":19787540,"url":"https://github.com/svish/cypress-hmr-restarter","last_synced_at":"2026-03-05T06:02:11.629Z","repository":{"id":36492427,"uuid":"227837570","full_name":"Svish/cypress-hmr-restarter","owner":"Svish","description":"A Cypress plugin which restarts tests on webpack-dev-server HMR updates","archived":false,"fork":false,"pushed_at":"2023-10-07T04:35:32.000Z","size":928,"stargazers_count":22,"open_issues_count":4,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-05T09:29:07.202Z","etag":null,"topics":["cypress","hmr","webpack","webpack-dev-server"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Svish.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-12-13T12:39:48.000Z","updated_at":"2023-08-22T16:02:58.000Z","dependencies_parsed_at":"2024-06-18T22:35:24.176Z","dependency_job_id":"06b0a5be-abc2-4db3-b769-e9bf1803de59","html_url":"https://github.com/Svish/cypress-hmr-restarter","commit_stats":null,"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"purl":"pkg:github/Svish/cypress-hmr-restarter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Svish%2Fcypress-hmr-restarter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Svish%2Fcypress-hmr-restarter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Svish%2Fcypress-hmr-restarter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Svish%2Fcypress-hmr-restarter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Svish","download_url":"https://codeload.github.com/Svish/cypress-hmr-restarter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Svish%2Fcypress-hmr-restarter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30111779,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T03:40:26.266Z","status":"ssl_error","status_checked_at":"2026-03-05T03:39:15.902Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cypress","hmr","webpack","webpack-dev-server"],"created_at":"2024-11-12T06:23:34.423Z","updated_at":"2026-03-05T06:02:11.596Z","avatar_url":"https://github.com/Svish.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cypress-hmr-restarter\n\nA rudimentary [Cypress](https://www.cypress.io/) plugin(?) for automatically restarting tests after Webpack [Hot Module Replacement](https://webpack.js.org/concepts/hot-module-replacement/) (HMR) updates.\n\n[![npm version](https://img.shields.io/npm/v/cypress-hmr-restarter.svg?style=flat-square) ![npm downloads](https://img.shields.io/npm/dm/cypress-hmr-restarter?style=flat-square)](https://www.npmjs.com/package/cypress-hmr-restarter)\n\n## Setup\n\n### 1. Install\n\n```shell\nnpm install --save-dev cypress-hmr-restarter\n```\n\n### 2. Import\n\n```js\n// E.g. in cypress/support/index.js\n\n// For webpack HMR (used in e.g. create-react-app or angular 11+)\nimport 'cypress-hmr-restarter';\n\n// For webpack-hot-middleware (used in e.g. gatsby)\nimport 'cypress-hmr-restarter/gatsby';\n```\n\n### 3. Make sure either `baseUrl` or `hmrUrl` is configured\n\n```jsonc\n// E.g. in cypress.json\n{\n  // Works with e.g. default create-react-app configuration\n  \"baseUrl\": \"http://localhost:3000\"\n}\n```\n\n## Options\n\n```jsonc\n{\n  // Overriding then URL used to connect, otherwise created from the baseUrl\n  \"hmrUrl\": \"ws://localhost:3000/sockjs-node\", // Default import\n  \"hmrUrl\": \"ws://localhost:3000/websocket\", // Angular 11+ import\n  \"hmrUrl\": \"http://localhost:3000/__webpack_hmr\", // Gatsby import\n\n  // Overrides delay between event and restart (ms)\n  \"hmrRestartDelay\": 1500\n}\n```\n\n## What it does\n\nWhen using the [Cypress Test Runner](https://docs.cypress.io/guides/core-concepts/test-runner.html) (`cypress open`), after the window has loaded, it will try to connect and listen for events. When an event signifying a change has happened, it will first try clicking the stop button, and then, after a short delay, it will click the restart button.\n\n- The default import connects to the [`webpack-dev-server`](https://www.npmjs.com/package/webpack-dev-server) websocket at either `\u003chmrUrl\u003e` or `ws://\u003cbaseUrl\u003e/sockjs-node` (`wss:` if `https:`), and listens for messages with the type `invalid`.\n\n  **IMPORTANT:** You need to ensure that [`transportMode`](https://webpack.js.org/configuration/dev-server/#devservertransportmode) option of `webpack-dev-server` is set to `ws` for the feature to work.\n\n- The gatsby import connects to the [`webpack-hot-middleware`](https://www.npmjs.com/package/webpack-hot-middleware) event source at either `\u003chmrUrl\u003e` or `\u003cbaseUrl\u003e/__webpack_hmr`, and listens for messages with the action `built`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsvish%2Fcypress-hmr-restarter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsvish%2Fcypress-hmr-restarter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsvish%2Fcypress-hmr-restarter/lists"}