cypress 13.16.1 → 14.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/angular/README.md +5 -0
  2. package/angular/angular/README.md +5 -0
  3. package/angular/angular/dist/index.d.ts +11 -2
  4. package/angular/angular/dist/index.js +944 -4
  5. package/angular/angular/package.json +16 -9
  6. package/angular/dist/index.d.ts +11 -2
  7. package/angular/dist/index.js +944 -4
  8. package/angular/package.json +16 -9
  9. package/lib/cli.js +1 -30
  10. package/lib/exec/spawn.js +17 -7
  11. package/mount-utils/dist/index.d.ts +0 -28
  12. package/mount-utils/dist/index.js +0 -27
  13. package/mount-utils/mount-utils/dist/index.d.ts +0 -28
  14. package/mount-utils/mount-utils/dist/index.js +0 -27
  15. package/package.json +5 -23
  16. package/react/README.md +5 -0
  17. package/react/dist/cypress-react.cjs.js +21 -676
  18. package/react/dist/cypress-react.esm-bundler.js +22 -676
  19. package/react/dist/index.d.ts +13 -30
  20. package/react/package.json +13 -15
  21. package/react/react/README.md +5 -0
  22. package/react/react/dist/cypress-react.cjs.js +21 -676
  23. package/react/react/dist/cypress-react.esm-bundler.js +22 -676
  24. package/react/react/dist/index.d.ts +13 -30
  25. package/react/react/package.json +13 -15
  26. package/svelte/README.md +6 -2
  27. package/svelte/dist/cypress-svelte.cjs.js +12 -12
  28. package/svelte/dist/cypress-svelte.esm-bundler.js +12 -12
  29. package/svelte/dist/index.d.ts +8 -179
  30. package/svelte/package.json +2 -2
  31. package/svelte/svelte/README.md +6 -2
  32. package/svelte/svelte/dist/cypress-svelte.cjs.js +12 -12
  33. package/svelte/svelte/dist/cypress-svelte.esm-bundler.js +12 -12
  34. package/svelte/svelte/dist/index.d.ts +8 -179
  35. package/svelte/svelte/package.json +2 -2
  36. package/types/cypress.d.ts +32 -49
  37. package/types/net-stubbing.d.ts +2 -7
  38. package/vue/dist/cypress-vue.cjs.js +380 -275
  39. package/vue/dist/cypress-vue.esm-bundler.js +382 -276
  40. package/vue/dist/index.d.ts +61 -78
  41. package/vue/package.json +2 -5
  42. package/vue/vue/dist/cypress-vue.cjs.js +380 -275
  43. package/vue/vue/dist/cypress-vue.esm-bundler.js +382 -276
  44. package/vue/vue/dist/index.d.ts +61 -78
  45. package/vue/vue/package.json +2 -5
  46. package/angular-signals/README.md +0 -11
  47. package/angular-signals/angular-signals/README.md +0 -11
  48. package/angular-signals/angular-signals/dist/index.d.ts +0 -136
  49. package/angular-signals/angular-signals/dist/index.js +0 -1861
  50. package/angular-signals/angular-signals/package.json +0 -74
  51. package/angular-signals/dist/index.d.ts +0 -136
  52. package/angular-signals/dist/index.js +0 -1861
  53. package/angular-signals/package.json +0 -74
  54. package/react18/README.md +0 -7
  55. package/react18/dist/cypress-react.cjs.js +0 -597
  56. package/react18/dist/cypress-react.esm-bundler.js +0 -574
  57. package/react18/dist/index.d.ts +0 -78
  58. package/react18/package.json +0 -71
  59. package/react18/react18/README.md +0 -7
  60. package/react18/react18/dist/cypress-react.cjs.js +0 -597
  61. package/react18/react18/dist/cypress-react.esm-bundler.js +0 -574
  62. package/react18/react18/dist/index.d.ts +0 -78
  63. package/react18/react18/package.json +0 -71
  64. package/vue2/README.md +0 -7
  65. package/vue2/dist/cypress-vue2.cjs.js +0 -20045
  66. package/vue2/dist/cypress-vue2.esm-bundler.js +0 -20042
  67. package/vue2/dist/index.d.ts +0 -207
  68. package/vue2/package.json +0 -65
  69. package/vue2/vue2/README.md +0 -7
  70. package/vue2/vue2/dist/cypress-vue2.cjs.js +0 -20045
  71. package/vue2/vue2/dist/cypress-vue2.esm-bundler.js +0 -20042
  72. package/vue2/vue2/dist/index.d.ts +0 -207
  73. package/vue2/vue2/package.json +0 -65
@@ -2,7 +2,7 @@
2
2
 
3
3
  import * as React from 'react';
4
4
  import React__default from 'react';
5
- import * as react_dom from 'react-dom';
5
+ import * as react_dom_client from 'react-dom/client';
6
6
 
7
7
  interface UnmountArgs {
8
8
  log: boolean;
@@ -10,7 +10,7 @@ interface UnmountArgs {
10
10
  }
11
11
  type MountOptions = Partial<MountReactComponentOptions>;
12
12
  interface MountReactComponentOptions {
13
- ReactDom: typeof react_dom;
13
+ ReactDom: typeof react_dom_client;
14
14
  /**
15
15
  * Log the mounting command into Cypress Command Log,
16
16
  * true by default.
@@ -23,8 +23,8 @@ interface MountReactComponentOptions {
23
23
  strict: boolean;
24
24
  }
25
25
  interface InternalMountOptions {
26
- reactDom: typeof react_dom;
27
- render: (reactComponent: ReturnType<typeof React__default.createElement>, el: HTMLElement, reactDomToUse: typeof react_dom) => void;
26
+ reactDom: typeof react_dom_client;
27
+ render: (reactComponent: ReturnType<typeof React__default.createElement>, el: HTMLElement, reactDomToUse: typeof react_dom_client) => void;
28
28
  unmount: (options: UnmountArgs) => void;
29
29
  cleanup: () => boolean;
30
30
  }
@@ -38,13 +38,6 @@ interface MountReturn {
38
38
  * or have asynchronous updates (`useEffect`, `useLayoutEffect`).
39
39
  */
40
40
  rerender: (component: React__default.ReactNode) => globalThis.Cypress.Chainable<MountReturn>;
41
- /**
42
- * Removes the mounted component.
43
- *
44
- * Removed as of Cypress 11.0.0.
45
- * @see https://on.cypress.io/migration-11-0-0-component-testing-updates
46
- */
47
- unmount: (payload: UnmountArgs) => void;
48
41
  }
49
42
 
50
43
  /**
@@ -78,10 +71,10 @@ declare const getContainerEl: () => HTMLElement;
78
71
 
79
72
  /**
80
73
  * Mounts a React component into the DOM.
81
- * @param jsx {React.ReactNode} The React component to mount.
82
- * @param options {MountOptions} [options={}] options to pass to the mount function.
83
- * @param rerenderKey {string} [rerenderKey] A key to use to force a rerender.
84
- * @see {@link https://on.cypress.io/mounting-react} for more details.
74
+ * @param {import('react').JSX.Element} jsx The React component to mount.
75
+ * @param {MountOptions} options Options to pass to the mount function.
76
+ * @param {string} rerenderKey A key to use to force a rerender.
77
+ *
85
78
  * @example
86
79
  * import { mount } from '@cypress/react'
87
80
  * import { Stepper } from './Stepper'
@@ -91,21 +84,11 @@ declare const getContainerEl: () => HTMLElement;
91
84
  * cy.get('[data-cy=increment]').click()
92
85
  * cy.get('[data-cy=counter]').should('have.text', '1')
93
86
  * }
87
+ *
88
+ * @see {@link https://on.cypress.io/mounting-react} for more details.
89
+ *
90
+ * @returns {Cypress.Chainable<MountReturn>} The mounted component.
94
91
  */
95
92
  declare function mount(jsx: React__default.ReactNode, options?: MountOptions, rerenderKey?: string): Cypress.Chainable<MountReturn>;
96
- /**
97
- * Removed as of Cypress 11.0.0.
98
- * @see https://on.cypress.io/migration-11-0-0-component-testing-updates
99
- */
100
- declare function unmount(options?: {
101
- log: boolean;
102
- }): void;
103
-
104
- /**
105
- * Mounts a React hook function in a test component for testing.
106
- * Removed as of Cypress 11.0.0.
107
- * @see https://on.cypress.io/migration-11-0-0-component-testing-updates
108
- */
109
- declare const mountHook: <T>(hookFn: (...args: any[]) => T) => void;
110
93
 
111
- export { InternalMountOptions, MountOptions, MountReactComponentOptions, MountReturn, UnmountArgs, createMount, getContainerEl, makeMountFn, makeUnmountFn, mount, mountHook, unmount };
94
+ export { InternalMountOptions, MountOptions, MountReactComponentOptions, MountReturn, UnmountArgs, createMount, getContainerEl, makeMountFn, makeUnmountFn, mount };
@@ -17,25 +17,26 @@
17
17
  },
18
18
  "devDependencies": {
19
19
  "@cypress/mount-utils": "0.0.0-development",
20
- "@types/semver": "7.5.0",
21
- "@vitejs/plugin-react": "4.3.0",
22
- "axios": "0.21.2",
20
+ "@types/semver": "7.5.8",
21
+ "@vitejs/plugin-react": "4.3.3",
22
+ "axios": "1.7.7",
23
23
  "cypress": "0.0.0-development",
24
- "prop-types": "15.7.2",
25
- "react": "17.0.2",
26
- "react-dom": "17.0.2",
27
- "react-router": "6.10.0",
28
- "react-router-dom": "6.10.0",
24
+ "prop-types": "15.8.1",
25
+ "react": "18.3.1",
26
+ "react-dom": "18.3.1",
27
+ "react-router": "6.28.0",
28
+ "react-router-dom": "6.28.0",
29
29
  "semver": "^7.5.3",
30
30
  "typescript": "~5.4.5",
31
- "vite": "5.2.11",
31
+ "vite": "5.4.10",
32
32
  "vite-plugin-require-transform": "1.0.12"
33
33
  },
34
34
  "peerDependencies": {
35
- "@types/react": "^16.9.16 || ^17.0.0",
35
+ "@types/react": "^18 || ^19",
36
+ "@types/react-dom": "^18 || ^19",
36
37
  "cypress": "*",
37
- "react": "^=16.x || ^=17.x",
38
- "react-dom": "^=16.x || ^=17.x"
38
+ "react": "^18 || ^19",
39
+ "react-dom": "^18 || ^19"
39
40
  },
40
41
  "files": [
41
42
  "dist"
@@ -90,9 +91,6 @@
90
91
  "nx": {
91
92
  "targets": {
92
93
  "build": {
93
- "dependsOn": [
94
- "!@cypress/react18:build"
95
- ],
96
94
  "outputs": [
97
95
  "{workspaceRoot}/cli/react",
98
96
  "{projectRoot}/dist"
@@ -3,6 +3,11 @@
3
3
  Mount React components in the open source [Cypress.io](https://www.cypress.io/) test runner
4
4
 
5
5
  > **Note:** This package is bundled with the `cypress` package and should not need to be installed separately. See the [React Component Testing Docs](https://docs.cypress.io/guides/component-testing/react/overview) for mounting React components. Installing and importing `mount` from `@cypress/react` should only be done for advanced use-cases.
6
+
7
+ ## Requirements
8
+
9
+ - React 18.0.0+ (Cypress 13 and under supports React 16 and 17)
10
+
6
11
  ## Development
7
12
 
8
13
  Run `yarn build` to compile and sync packages to the `cypress` cli package.