-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
breaking: remove deprecated before:browser:launch signature code that…
… allowed Arrays (#30460) * chore: release 13.15.1 (#30454) * chore: Update Chrome (beta) to 131.0.6778.13 (#30451) Co-authored-by: cypress-bot[bot] <41898282+cypress-bot[bot]@users.noreply.github.com> * remove deprecated before:browser:launch signature code * Update changelog * Update snapshots & failing tests BREAKING: remove deprecated before:browser:launch signature code that allowed Arrays * Add back options * update test spec to use non deprecated before:browser:launch signature * removed test for deprecated before:browser:launch signature --------- Co-authored-by: Bill Glesias <bglesias@gmail.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: cypress-bot[bot] <41898282+cypress-bot[bot]@users.noreply.github.com>
- Loading branch information
1 parent
fd8c2a3
commit 7f6e030
Showing
12 changed files
with
29 additions
and
715 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 0 additions & 44 deletions
44
packages/errors/__snapshot-html__/DEPRECATED_BEFORE_BROWSER_LAUNCH_ARGS.html
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,7 @@ | ||
const util = require('../util') | ||
|
||
const ARRAY_METHODS = ['concat', 'push', 'unshift', 'slice', 'pop', 'shift', 'slice', 'splice', 'filter', 'map', 'forEach', 'reduce', 'reverse', 'splice', 'includes'] | ||
|
||
module.exports = { | ||
wrapBefore (ipc, invoke, ids, args) { | ||
// TODO: remove in next breaking release | ||
// This will send a warning message when a deprecated API is used | ||
// define array-like functions on this object so we can warn about using deprecated array API | ||
// while still fulfilling desired behavior | ||
const [, launchOptions] = args | ||
|
||
let hasEmittedWarning = false | ||
|
||
ARRAY_METHODS.forEach((name) => { | ||
const boundFn = launchOptions.args[name].bind(launchOptions.args) | ||
|
||
launchOptions[name] = function () { | ||
if (hasEmittedWarning) return | ||
|
||
hasEmittedWarning = true | ||
|
||
const warning = require('@packages/errors').getError( | ||
'DEPRECATED_BEFORE_BROWSER_LAUNCH_ARGS', | ||
) | ||
|
||
ipc.send('warning', util.serializeError(warning)) | ||
|
||
// eslint-disable-next-line prefer-rest-params | ||
return boundFn.apply(this, arguments) | ||
} | ||
}) | ||
|
||
Object.defineProperty(launchOptions, 'length', { | ||
get () { | ||
return this.args.length | ||
}, | ||
}) | ||
|
||
launchOptions[Symbol.iterator] = launchOptions.args[Symbol.iterator].bind(launchOptions.args) | ||
|
||
util.wrapChildPromise(ipc, invoke, ids, args) | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
7f6e030
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Circle has built the
linux x64
version of the Test Runner.Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version
Run this command to install the pre-release locally:
7f6e030
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Circle has built the
linux arm64
version of the Test Runner.Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version
Run this command to install the pre-release locally: