Skip to content

Commit

Permalink
docs: add documentation for experimentalOriginDependencies (#4897)
Browse files Browse the repository at this point in the history
  • Loading branch information
mschile authored Dec 5, 2022
1 parent b83a6ac commit fa0e7a8
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 12 deletions.
24 changes: 17 additions & 7 deletions content/api/commands/origin.md
Original file line number Diff line number Diff line change
Expand Up @@ -408,18 +408,28 @@ packages and other files.

<Alert type="warning">

Using `import()` and `require()` within the callback requires version 5.15.0 or
greater of the
Using `import()` and `require()` within the callback requires enabling the
[`experimentalOriginDependencies`](/guides/references/experiments) flag in the
Cypress configuration and using version `5.15.0` or greater of the
[`@cypress/webpack-preprocessor`](https://github.com/cypress-io/cypress/tree/master/npm/webpack-preprocessor).
This is included in Cypress by default, but if your project installs its own
version of `@cypress/webpack-preprocessor` that is set up in your Cypress
config, make sure it is version 5.15.0 or greater.
The `@cypress/webpack-preprocessor` is included in Cypress by default, but if
your project installs its own version in the Cypress configuration, make sure it
is version `5.15.0` or greater.

If using an older version of the webpack or a different preprocessor, you'll see
an error that includes the following text:

_Using require() or import() to include dependencies requires using the latest
version of @cypress/webpack-preprocessor._
_Using `require()` or `import()` to include dependencies requires enabling the
`experimentalOriginDependencies` flag and using the latest version of
`@cypress/webpack-preprocessor`._

</Alert>

<Alert type="warning">

Using `require()` or `import()` within the callback from a `node_modules` plugin
is not currently supported. We anticipate adding support with issue
[#24976](https://github.com/cypress-io/cypress/issues/24976).

</Alert>

Expand Down
11 changes: 6 additions & 5 deletions content/guides/references/experiments.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,11 @@ creating `e2e` and `component` objects inside your Cypress configuration.
These experiments are available to be specified inside the `e2e` configuration
object:

| Option | Default | Description |
| ------------------------- | ------- | --------------------------------------------------------------------------------------------------------- |
| `experimentalStudio` | `false` | Generate and save commands directly to your test suite by interacting with your app as an end user would. |
| `experimentalRunAllSpecs` | `false` | Enables the "Run All Specs" UI feature, allowing the execution of multiple specs sequentially. |
| Option | Default | Description |
| -------------------------------- | ------- | --------------------------------------------------------------------------------------------------------- |
| `experimentalStudio` | `false` | Generate and save commands directly to your test suite by interacting with your app as an end user would. |
| `experimentalRunAllSpecs` | `false` | Enables the "Run All Specs" UI feature, allowing the execution of multiple specs sequentially. |
| `experimentalOriginDependencies` | `false` | Enables support for `require`/`import` within `cy.origin`. |

### Component Testing

Expand All @@ -57,7 +58,7 @@ configuration object:

| Version | Changes |
| --------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| [12.0.0](/guides/references/changelog#12-0-0) | Removed `experimentalSessionAndOrigin` and made it the default behavior. |
| [12.0.0](/guides/references/changelog#12-0-0) | Removed `experimentalSessionAndOrigin` and made it the default behavior. Added `experimentalOriginDependencies`. |
| [11.2.0](/guides/references/changelog#11-2-0) | Added `experimentalRunAllSpecs`. |
| [10.8.0](/guides/references/changelog#10-8-0) | Added `experimentalWebKitSupport`. |
| [10.6.0](/guides/references/changelog#10-6-0) | Added support for `experimentalSingleTabRunMode`. |
Expand Down

0 comments on commit fa0e7a8

Please sign in to comment.