cypress 13.2.0 → 13.3.1
Sign up to get free protection for your applications and to get access to all the features.
- package/angular/angular/README.md +10 -0
- package/angular/angular/dist/index.d.ts +128 -0
- package/angular/angular/dist/index.js +333 -0
- package/angular/angular/package.json +77 -0
- package/angular/package.json +9 -1
- package/lib/exec/spawn.js +1 -1
- package/lib/util.js +1 -1
- package/mount-utils/mount-utils/README.md +140 -0
- package/mount-utils/mount-utils/dist/index.d.ts +40 -0
- package/mount-utils/mount-utils/dist/index.js +68 -0
- package/mount-utils/mount-utils/package.json +46 -0
- package/mount-utils/package.json +10 -1
- package/package.json +20 -4
- package/react/package.json +13 -0
- package/react/react/README.md +14 -0
- package/react/react/dist/cypress-react.cjs.js +943 -0
- package/react/react/dist/cypress-react.esm-bundler.js +917 -0
- package/react/react/dist/index.d.ts +111 -0
- package/react/react/package.json +111 -0
- package/react18/package.json +10 -0
- package/react18/react18/README.md +7 -0
- package/react18/react18/dist/cypress-react.cjs.js +592 -0
- package/react18/react18/dist/cypress-react.esm-bundler.js +569 -0
- package/react18/react18/dist/index.d.ts +78 -0
- package/react18/react18/package.json +71 -0
- package/svelte/package.json +13 -1
- package/svelte/svelte/README.md +15 -0
- package/svelte/svelte/dist/cypress-svelte.cjs.js +122 -0
- package/svelte/svelte/dist/cypress-svelte.esm-bundler.js +120 -0
- package/svelte/svelte/dist/index.d.ts +201 -0
- package/svelte/svelte/package.json +56 -0
- package/types/cypress.d.ts +2 -2
- package/vue/package.json +13 -1
- package/vue/vue/README.md +14 -0
- package/vue/vue/dist/cypress-vue.cjs.js +8582 -0
- package/vue/vue/dist/cypress-vue.esm-bundler.js +8560 -0
- package/vue/vue/dist/index.d.ts +1392 -0
- package/vue/vue/package.json +96 -0
- package/vue2/dist/cypress-vue2.cjs.js +1 -1
- package/vue2/dist/cypress-vue2.esm-bundler.js +1 -1
- package/vue2/package.json +13 -1
- package/vue2/vue2/README.md +7 -0
- package/vue2/vue2/dist/cypress-vue2.cjs.js +20045 -0
- package/vue2/vue2/dist/cypress-vue2.esm-bundler.js +20042 -0
- package/vue2/vue2/dist/index.d.ts +364 -0
- package/vue2/vue2/package.json +65 -0
@@ -0,0 +1,111 @@
|
|
1
|
+
/// <reference types="cypress" />
|
2
|
+
|
3
|
+
import * as React from 'react';
|
4
|
+
import React__default from 'react';
|
5
|
+
import * as react_dom from 'react-dom';
|
6
|
+
|
7
|
+
interface UnmountArgs {
|
8
|
+
log: boolean;
|
9
|
+
boundComponentMessage?: string;
|
10
|
+
}
|
11
|
+
declare type MountOptions = Partial<MountReactComponentOptions>;
|
12
|
+
interface MountReactComponentOptions {
|
13
|
+
ReactDom: typeof react_dom;
|
14
|
+
/**
|
15
|
+
* Log the mounting command into Cypress Command Log,
|
16
|
+
* true by default.
|
17
|
+
*/
|
18
|
+
log: boolean;
|
19
|
+
/**
|
20
|
+
* Render component in React [strict mode](https://reactjs.org/docs/strict-mode.html)
|
21
|
+
* It activates additional checks and warnings for child components.
|
22
|
+
*/
|
23
|
+
strict: boolean;
|
24
|
+
}
|
25
|
+
interface InternalMountOptions {
|
26
|
+
reactDom: typeof react_dom;
|
27
|
+
render: (reactComponent: ReturnType<typeof React__default.createElement>, el: HTMLElement, reactDomToUse: typeof react_dom) => void;
|
28
|
+
unmount: (options: UnmountArgs) => void;
|
29
|
+
cleanup: () => boolean;
|
30
|
+
}
|
31
|
+
interface MountReturn {
|
32
|
+
/**
|
33
|
+
* The component that was rendered.
|
34
|
+
*/
|
35
|
+
component: React__default.ReactNode;
|
36
|
+
/**
|
37
|
+
* Rerenders the specified component with new props. This allows testing of components that store state (`setState`)
|
38
|
+
* or have asynchronous updates (`useEffect`, `useLayoutEffect`).
|
39
|
+
*/
|
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
|
+
}
|
49
|
+
|
50
|
+
/**
|
51
|
+
* Create an `mount` function. Performs all the non-React-version specific
|
52
|
+
* behavior related to mounting. The React-version-specific code
|
53
|
+
* is injected. This helps us to maintain a consistent public API
|
54
|
+
* and handle breaking changes in React's rendering API.
|
55
|
+
*
|
56
|
+
* This is designed to be consumed by `npm/react{16,17,18}`, and other React adapters,
|
57
|
+
* or people writing adapters for third-party, custom adapters.
|
58
|
+
*/
|
59
|
+
declare const makeMountFn: (type: 'mount' | 'rerender', jsx: React.ReactNode, options?: MountOptions, rerenderKey?: string, internalMountOptions?: InternalMountOptions) => globalThis.Cypress.Chainable<MountReturn>;
|
60
|
+
/**
|
61
|
+
* Create an `unmount` function. Performs all the non-React-version specific
|
62
|
+
* behavior related to unmounting.
|
63
|
+
*
|
64
|
+
* This is designed to be consumed by `npm/react{16,17,18}`, and other React adapters,
|
65
|
+
* or people writing adapters for third-party, custom adapters.
|
66
|
+
*
|
67
|
+
* @param {UnmountArgs} options used during unmounting
|
68
|
+
*/
|
69
|
+
declare const makeUnmountFn: (options: UnmountArgs) => Cypress.Chainable<undefined>;
|
70
|
+
declare const createMount: (defaultOptions: MountOptions) => (element: React.ReactElement, options?: MountOptions) => Cypress.Chainable<MountReturn>;
|
71
|
+
|
72
|
+
/**
|
73
|
+
* Gets the root element used to mount the component.
|
74
|
+
* @returns {HTMLElement} The root element
|
75
|
+
* @throws {Error} If the root element is not found
|
76
|
+
*/
|
77
|
+
declare const getContainerEl: () => HTMLElement;
|
78
|
+
|
79
|
+
/**
|
80
|
+
* 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.
|
85
|
+
* @example
|
86
|
+
* import { mount } from '@cypress/react'
|
87
|
+
* import { Stepper } from './Stepper'
|
88
|
+
*
|
89
|
+
* it('mounts', () => {
|
90
|
+
* mount(<StepperComponent />)
|
91
|
+
* cy.get('[data-cy=increment]').click()
|
92
|
+
* cy.get('[data-cy=counter]').should('have.text', '1')
|
93
|
+
* }
|
94
|
+
*/
|
95
|
+
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
|
+
|
111
|
+
export { InternalMountOptions, MountOptions, MountReactComponentOptions, MountReturn, UnmountArgs, createMount, getContainerEl, makeMountFn, makeUnmountFn, mount, mountHook, unmount };
|
@@ -0,0 +1,111 @@
|
|
1
|
+
{
|
2
|
+
"name": "@cypress/react",
|
3
|
+
"version": "0.0.0-development",
|
4
|
+
"description": "Test React components using Cypress",
|
5
|
+
"main": "dist/cypress-react.cjs.js",
|
6
|
+
"scripts": {
|
7
|
+
"build": "rimraf dist && rollup -c rollup.config.mjs",
|
8
|
+
"postbuild": "node ../../scripts/sync-exported-npm-with-cli.js",
|
9
|
+
"check-ts": "tsc --noEmit",
|
10
|
+
"cy:open": "node ../../scripts/cypress.js open --component",
|
11
|
+
"cy:open:debug": "node --inspect-brk ../../scripts/start.js --component-testing --run-project ${PWD}",
|
12
|
+
"cy:run": "node ../../scripts/cypress.js run --component",
|
13
|
+
"cy:run:debug": "node --inspect-brk ../../scripts/start.js --component-testing --run-project ${PWD}",
|
14
|
+
"test": "yarn cy:run",
|
15
|
+
"lint": "eslint --ext .js,.jsx,.ts,.tsx,.json, .",
|
16
|
+
"watch": "yarn build --watch --watch.exclude ./dist/**/*"
|
17
|
+
},
|
18
|
+
"devDependencies": {
|
19
|
+
"@cypress/mount-utils": "0.0.0-development",
|
20
|
+
"@types/semver": "7.5.0",
|
21
|
+
"@vitejs/plugin-react": "4.0.0",
|
22
|
+
"axios": "0.21.2",
|
23
|
+
"cypress": "0.0.0-development",
|
24
|
+
"prop-types": "15.7.2",
|
25
|
+
"react": "16.8.6",
|
26
|
+
"react-dom": "16.8.6",
|
27
|
+
"react-router": "6.0.0-alpha.1",
|
28
|
+
"react-router-dom": "6.0.0-alpha.1",
|
29
|
+
"semver": "^7.5.3",
|
30
|
+
"typescript": "^4.7.4",
|
31
|
+
"vite": "4.3.2",
|
32
|
+
"vite-plugin-require-transform": "1.0.12"
|
33
|
+
},
|
34
|
+
"peerDependencies": {
|
35
|
+
"@types/react": "^16.9.16 || ^17.0.0",
|
36
|
+
"cypress": "*",
|
37
|
+
"react": "^=16.x || ^=17.x",
|
38
|
+
"react-dom": "^=16.x || ^=17.x"
|
39
|
+
},
|
40
|
+
"files": [
|
41
|
+
"dist"
|
42
|
+
],
|
43
|
+
"types": "dist/index.d.ts",
|
44
|
+
"license": "MIT",
|
45
|
+
"repository": {
|
46
|
+
"type": "git",
|
47
|
+
"url": "https://github.com/cypress-io/cypress.git"
|
48
|
+
},
|
49
|
+
"homepage": "https://github.com/cypress-io/cypress/blob/develop/npm/react/#readme",
|
50
|
+
"author": "Gleb Bahmutov <gleb.bahmutov@gmail.com>",
|
51
|
+
"bugs": "https://github.com/cypress-io/cypress/issues/new?assignees=&labels=npm%3A%20%40cypress%2Freact&template=1-bug-report.md&title=",
|
52
|
+
"keywords": [
|
53
|
+
"react",
|
54
|
+
"cypress",
|
55
|
+
"cypress-io",
|
56
|
+
"test",
|
57
|
+
"testing"
|
58
|
+
],
|
59
|
+
"contributors": [
|
60
|
+
{
|
61
|
+
"name": "Dmitriy Kovalenko",
|
62
|
+
"social": "@dmtrKovalenko"
|
63
|
+
},
|
64
|
+
{
|
65
|
+
"name": "Brian Mann",
|
66
|
+
"social": "@brian-mann"
|
67
|
+
},
|
68
|
+
{
|
69
|
+
"name": "Barthélémy Ledoux",
|
70
|
+
"social": "@elevatebart"
|
71
|
+
},
|
72
|
+
{
|
73
|
+
"name": "Lachlan Miller",
|
74
|
+
"social": "@lmiller1990"
|
75
|
+
},
|
76
|
+
{
|
77
|
+
"name": "Jessica Sachs",
|
78
|
+
"social": "@_JessicaSachs"
|
79
|
+
}
|
80
|
+
],
|
81
|
+
"unpkg": "dist/cypress-react.browser.js",
|
82
|
+
"module": "dist/cypress-react.esm-bundler.js",
|
83
|
+
"peerDependenciesMeta": {
|
84
|
+
"@types/react": {
|
85
|
+
"optional": true
|
86
|
+
}
|
87
|
+
},
|
88
|
+
"publishConfig": {
|
89
|
+
"access": "public"
|
90
|
+
},
|
91
|
+
"nx": {
|
92
|
+
"targets": {
|
93
|
+
"build": {
|
94
|
+
"dependsOn": [
|
95
|
+
"!@cypress/react18:build"
|
96
|
+
],
|
97
|
+
"outputs": [
|
98
|
+
"{workspaceRoot}/cli/react",
|
99
|
+
"{projectRoot}/dist"
|
100
|
+
]
|
101
|
+
}
|
102
|
+
}
|
103
|
+
},
|
104
|
+
"standard": {
|
105
|
+
"globals": [
|
106
|
+
"Cypress",
|
107
|
+
"cy",
|
108
|
+
"expect"
|
109
|
+
]
|
110
|
+
}
|
111
|
+
}
|
package/react18/package.json
CHANGED
@@ -0,0 +1,7 @@
|
|
1
|
+
# @cypress/react18
|
2
|
+
|
3
|
+
Mount React 18 components in the open source [Cypress.io](https://www.cypress.io/) test runner
|
4
|
+
|
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/react18` should only be done for advanced use-cases.
|
6
|
+
|
7
|
+
## [Changelog](./CHANGELOG.md)
|