Skip to content

Commit b6a77ea

Browse files
laiscoolbluejennifer-shehanerenovate-bothiwanzrenovate[bot]
authored
Rename configuration option blacklistHosts to blocklistHosts (#2861)
Co-authored-by: Jennifer Shehane <[email protected]> Co-authored-by: Jennifer Shehane <[email protected]> Co-authored-by: Renovate Bot <[email protected]> Co-authored-by: 丸子 <[email protected]> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
1 parent 0e35b96 commit b6a77ea

File tree

5 files changed

+10
-8
lines changed

5 files changed

+10
-8
lines changed

.textlintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
["craziest", "most complex"],
8787
["dumb", "unintended"],
8888
["insane", "outrageous"],
89-
["blacklist", "blocklist"],
89+
["blacklist", "block"],
9090
["whitelist", "allow"],
9191

9292
// Prefer American spelling

cypress.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"baseUrl": "http://localhost:2222",
33
"projectId": "ma3dkn",
44
"viewportWidth": 1500,
5-
"blacklistHosts": ["trackcmp.net", "js.hs-analytics.net", "js.hs-scripts.com"]
5+
"blocklistHosts": ["trackcmp.net", "js.hs-analytics.net", "js.hs-scripts.com"]
66
}

source/faq/questions/using-cypress-faq.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ Yes. {% url "You can override this with `userAgent` in your configuration file (
281281

282282
## {% fa fa-angle-right %} Can I block traffic going to specific domains? I want to block Google Analytics or other providers.
283283

284-
Yes. {% url "You can set this with `blacklistHosts` in your configuration file (`cypress.json` by default)." configuration#Browser %}
284+
Yes. {% url "You can set this with `blockHosts` in your configuration file (`cypress.json` by default)." configuration#Browser %}
285285

286286
Also, check out our {% url 'Stubbing Google Analytics Recipe' recipes#Stubbing-and-spying %}.
287287

source/guides/overview/key-differences.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Having ultimate control over your application, the network traffic, and native a
3737
- Test how your application responds to errors on your server by {% url "modifying response status codes to be 500" route %>.
3838
- Modify DOM elements directly - like forcing hidden elements to be shown.
3939
- Use 3rd party plugins programmatically. Instead of fussing with complex UI widgets like multi selects, autocompletes, drop downs, tree views or calendars, you can call methods directly from your test code to control them.
40-
- <% url "Prevent Google Analytics from loading *before* any of your application code executes" configuration#blacklistHosts %> when testing.
40+
- <% url "Prevent Google Analytics from loading *before* any of your application code executes" configuration#blockhosts %> when testing.
4141
- Get synchronous notifications whenever your application transitions to a new page or when it begins to unload.
4242
- {% url "Control time by moving forward or backward" clock %} so that timers or polls automatically fire without having to wait for the required time in your tests.
4343
- Add your own event listeners to respond to your application. You could update your application code to behave differently when under tests in Cypress. You can control WebSocket messages from within Cypress, conditionally load 3rd party scripts, or call functions directly on your application.

source/guides/references/configuration.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ Option | Default | Description
7777
Option | Default | Description
7878
----- | ---- | ----
7979
`chromeWebSecurity` | `true` | Whether to enable Chromium-based browser's Web Security for same-origin policy and insecure mixed content. {% url 'Read more about Web Security' web-security %}.
80-
`blacklistHosts` | `null` | A String or Array of hosts that you wish to block traffic for. {% urlHash 'Please read the notes for examples on using this.' blacklistHosts %}
80+
`blockHosts` | `null` | A String or Array of hosts that you wish to block traffic for. {% urlHash 'Please read the notes for examples on using this.' blockHosts %}
8181
`firefoxGcInterval` | `{ "runMode": 1, "openMode": null }` | Controls whether Cypress forces Firefox to run garbage collection (GC) cleanup and how frequently. During {% url "`cypress run`" command-line#cypress-run %}, the default value is `1`. During {% url "`cypress open`" command-line#cypress-open %}, the default value is `null`. See full details {% urlHash "here" firefoxGcInterval %}.
8282
`modifyObstructiveCode` | `true` | Whether Cypress will search for and replace obstructive JS code in `.js` or `.html` files. {% urlHash 'Please read the notes for more information on this setting.' modifyObstructiveCode %}
8383
`userAgent` | `null` | Enables you to override the default user agent the browser sends in all request headers. User agent values are typically used by servers to help identify the operating system, browser, and browser version. See {% url "User-Agent MDN Documentation" https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent %} for example user agent values.
@@ -258,7 +258,7 @@ When you open a Cypress project, clicking on the **Settings** tab will display t
258258

259259
# Notes
260260

261-
## `blacklistHosts`
261+
## blockHosts
262262

263263
By passing a string or array of strings you can block requests made to one or more hosts.
264264

@@ -307,7 +307,7 @@ For instance given a URL: `https://google.com/search?q=cypress`
307307
- {% fa fa-exclamation-triangle red %} Does NOT match `*.google.com`
308308
{% endnote %}
309309

310-
When Cypress blocks a request made to a matching host, it will automatically send a `503` status code. As a convenience it also sets a `x-cypress-matched-blacklist-host` header so you can see which rule it matched.
310+
When Cypress blocks a request made to a matching host, it will automatically send a `503` status code. As a convenience it also sets a `x-cypress-matched-blocked-host` header so you can see which rule it matched.
311311

312312
{% imgTag /img/guides/blocked-host.png "Network tab of dev tools with analytics.js request selected and the response header highlighted " %}
313313

@@ -394,7 +394,9 @@ Run GC cleanup before every 3rd test during {% url "`cypress run`" command-line#
394394
IntelliSense is available for Cypress while editing your configuration file. {% url "Learn how to set up Intelligent Code Completion." IDE-integration#Intelligent-Code-Completion %}
395395

396396
{% history %}
397-
{% url "3.5.0" changelog %} | Added support for option `nodeVersion`
397+
{% url "5.0.0" changelog %} | Renamed `blacklistHosts` to `blockHosts`
398+
{% url "4.0.0" changelog %} | Added `firefoxGcInterval` configuration option
399+
{% url "3.5.0" changelog %} | Added `nodeVersion` configuration option
398400
{% endhistory %}
399401

400402
# See also

0 commit comments

Comments
 (0)