cypress 16.2.1 → 16.3.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 (49) hide show
  1. package/angular/dist/index.js +4 -5
  2. package/dist/bin/cypress +8 -8
  3. package/dist/{cli-DoJnc1F1.js → cli-y9Bb9Y77.js} +212 -38
  4. package/dist/cli.js +6 -6
  5. package/dist/{cypress-BTgp4zGi.js → cypress-CvEs5adm.js} +2 -2
  6. package/dist/cypress.js +8 -8
  7. package/dist/exec/spawn.js +4 -4
  8. package/dist/exec/xvfb.js +7 -4
  9. package/dist/index.js +8 -8
  10. package/dist/{spawn-zPuxj7Kz.js → spawn-Bx99tBTm.js} +527 -67
  11. package/dist/{tap-D2mHgoNE.js → tap-BMFGLoCT.js} +108 -26
  12. package/dist/{xvfb-CbW2_YXR.js → xvfb-DxbcANVl.js} +238 -25
  13. package/mount-utils/dist/index.js +1 -0
  14. package/mount-utils/package.json +1 -0
  15. package/package.json +4 -4
  16. package/react/dist/cypress-react.cjs.js +4 -1
  17. package/react/dist/cypress-react.esm-bundler.js +4 -1
  18. package/svelte/dist/cypress-svelte.cjs.js +3 -1
  19. package/svelte/dist/cypress-svelte.esm-bundler.js +3 -1
  20. package/types/cy-bluebird.d.ts +1 -0
  21. package/types/cypress.d.ts +8 -1
  22. package/types/net-stubbing.d.ts +1 -1
  23. package/vue/dist/cypress-vue.cjs.js +3 -0
  24. package/vue/dist/cypress-vue.esm-bundler.js +3 -0
  25. package/vue/dist/index.d.ts +3 -3
  26. package/vue/package.json +1 -1
  27. package/angular/angular/README.md +0 -18
  28. package/angular/angular/dist/index.d.ts +0 -120
  29. package/angular/angular/dist/index.js +0 -478
  30. package/angular/angular/package.json +0 -67
  31. package/mount-utils/mount-utils/README.md +0 -140
  32. package/mount-utils/mount-utils/dist/index.d.ts +0 -12
  33. package/mount-utils/mount-utils/dist/index.js +0 -40
  34. package/mount-utils/mount-utils/package.json +0 -52
  35. package/react/react/README.md +0 -19
  36. package/react/react/dist/cypress-react.cjs.js +0 -292
  37. package/react/react/dist/cypress-react.esm-bundler.js +0 -267
  38. package/react/react/dist/index.d.ts +0 -95
  39. package/react/react/package.json +0 -93
  40. package/svelte/svelte/README.md +0 -19
  41. package/svelte/svelte/dist/cypress-svelte.cjs.js +0 -121
  42. package/svelte/svelte/dist/cypress-svelte.esm-bundler.js +0 -119
  43. package/svelte/svelte/dist/index.d.ts +0 -31
  44. package/svelte/svelte/package.json +0 -65
  45. package/vue/vue/README.md +0 -14
  46. package/vue/vue/dist/cypress-vue.cjs.js +0 -8691
  47. package/vue/vue/dist/cypress-vue.esm-bundler.js +0 -8670
  48. package/vue/vue/dist/index.d.ts +0 -1413
  49. package/vue/vue/package.json +0 -90
@@ -1,119 +0,0 @@
1
-
2
- /**
3
- * @cypress/svelte v0.0.0-development
4
- * (c) 2026 Cypress.io
5
- * Released under the MIT License
6
- */
7
-
8
- import { mount as mount$1, unmount } from 'svelte';
9
-
10
- const ROOT_SELECTOR = '[data-cy-root]';
11
- /**
12
- * Gets the root element used to mount the component.
13
- * @returns {HTMLElement} The root element
14
- * @throws {Error} If the root element is not found
15
- */
16
- const getContainerEl = () => {
17
- const el = document.querySelector(ROOT_SELECTOR);
18
- if (el) {
19
- return el;
20
- }
21
- throw Error(`No element found that matches selector ${ROOT_SELECTOR}. Please add a root element with data-cy-root attribute to your "component-index.html" file so that Cypress can attach your component to the DOM.`);
22
- };
23
- /**
24
- * Utility function to register CT side effects and run cleanup code during the "test:before:run" Cypress hook
25
- * @param optionalCallback Callback to be called before the next test runs
26
- */
27
- function setupHooks(optionalCallback) {
28
- // We don't want CT side effects to run when e2e
29
- // testing so we early return.
30
- // System test to verify CT side effects do not pollute e2e: system-tests/test/e2e_with_mount_import_spec.ts
31
- if (Cypress.testingType !== 'component') {
32
- return;
33
- }
34
- // When running component specs, we cannot allow "cy.visit"
35
- // because it will wipe out our preparation work, and does not make much sense
36
- // thus we overwrite "cy.visit" to throw an error
37
- Cypress.Commands.overwrite('visit', () => {
38
- throw new Error('cy.visit from a component spec is not allowed');
39
- });
40
- Cypress.Commands.overwrite('session', () => {
41
- throw new Error('cy.session from a component spec is not allowed');
42
- });
43
- Cypress.Commands.overwrite('origin', () => {
44
- throw new Error('cy.origin from a component spec is not allowed');
45
- });
46
- Cypress.on('test:before:after:run:async', () => {
47
- optionalCallback?.();
48
- });
49
- }
50
-
51
- const DEFAULT_COMP_NAME = 'unknown';
52
- let componentInstance;
53
- const cleanup = () => {
54
- if (componentInstance) {
55
- unmount(componentInstance);
56
- }
57
- };
58
- // Extract the component name from the object passed to mount
59
- const getComponentDisplayName = (Component) => {
60
- if (Component.name) {
61
- const [, match] = /Proxy\<(\w+)\>/.exec(Component.name) || [];
62
- return match || Component.name;
63
- }
64
- return DEFAULT_COMP_NAME;
65
- };
66
- /**
67
- * Mounts a Svelte component inside the Cypress browser
68
- *
69
- * @param {Record<string, any>} Component Svelte component being mounted
70
- * @param {MountReturn<T extends SvelteComponent>} options options to customize the component being mounted
71
- * @returns Cypress.Chainable<MountReturn>
72
- *
73
- * @example
74
- * import Counter from './Counter.svelte'
75
- * import { mount } from 'cypress/svelte'
76
- *
77
- * it('should render', () => {
78
- * mount(Counter, { props: { count: 42 } })
79
- * cy.get('button').contains(42)
80
- * })
81
- *
82
- * @see {@link https://on.cypress.io/mounting-svelte} for more details.
83
- */
84
- function mount(Component, options = {}) {
85
- // In Svelte 5, the component name is no longer easily discoverable and logs as "wrapper"
86
- // so we default the logging of it to false as it doesn't provide a lot of value
87
- options.log = options.log || false;
88
- return cy.then(() => {
89
- // Remove last mounted component if cy.mount is called more than once in a test
90
- cleanup();
91
- const target = getContainerEl();
92
- const ComponentConstructor = (Component.default || Component);
93
- // @see https://svelte.dev/docs/svelte/v5-migration-guide#Components-are-no-longer-classes
94
- componentInstance = mount$1(ComponentConstructor, Object.assign({ target }, options));
95
- // by waiting, we are delaying test execution for the next tick of event loop
96
- // and letting hooks and component lifecycle methods to execute mount
97
- return cy.wait(0, { log: false }).then(() => {
98
- if (options.log !== false) {
99
- const mountMessage = `<${getComponentDisplayName(Component)} ... />`;
100
- Cypress.log({
101
- name: 'mount',
102
- message: [mountMessage],
103
- });
104
- }
105
- })
106
- .wrap({ component: componentInstance }, { log: false });
107
- });
108
- }
109
- // Side effects from "import { mount } from '@cypress/<my-framework>'" are annoying, we should avoid doing this
110
- // by creating an explicit function/import that the user can register in their 'component.js' support file,
111
- // such as:
112
- // import 'cypress/<my-framework>/support'
113
- // or
114
- // import { registerCT } from 'cypress/<my-framework>'
115
- // registerCT()
116
- // Note: This would be a breaking change
117
- setupHooks(cleanup);
118
-
119
- export { mount };
@@ -1,31 +0,0 @@
1
- /// <reference types="cypress" />
2
-
3
- import { Component, MountOptions } from 'svelte';
4
-
5
- interface MountReturn {
6
- component: Record<string, any>;
7
- }
8
- /**
9
- * Mounts a Svelte component inside the Cypress browser
10
- *
11
- * @param {Record<string, any>} Component Svelte component being mounted
12
- * @param {MountReturn<T extends SvelteComponent>} options options to customize the component being mounted
13
- * @returns Cypress.Chainable<MountReturn>
14
- *
15
- * @example
16
- * import Counter from './Counter.svelte'
17
- * import { mount } from 'cypress/svelte'
18
- *
19
- * it('should render', () => {
20
- * mount(Counter, { props: { count: 42 } })
21
- * cy.get('button').contains(42)
22
- * })
23
- *
24
- * @see {@link https://on.cypress.io/mounting-svelte} for more details.
25
- */
26
- declare function mount(Component: Component<Record<string, any>, Record<string, any>, any>, options?: Omit<MountOptions, 'target'> & {
27
- log?: boolean;
28
- }): Cypress.Chainable<MountReturn>;
29
-
30
- export { mount };
31
- export type { MountReturn };
@@ -1,65 +0,0 @@
1
- {
2
- "name": "@cypress/svelte",
3
- "version": "0.0.0-development",
4
- "description": "Browser-based Component Testing for Svelte.js with Cypress.io 🧡",
5
- "keywords": [
6
- "cypress",
7
- "svelte",
8
- "svelte5",
9
- "component-testing",
10
- "svelte-testing",
11
- "testing"
12
- ],
13
- "homepage": "https://github.com/cypress-io/cypress/blob/develop/npm/svelte/#readme",
14
- "bugs": "https://github.com/cypress-io/cypress/issues/new?assignees=&labels=npm%3A%20%40cypress%2Fsvelte&template=1-bug-report.md&title=",
15
- "repository": {
16
- "type": "git",
17
- "url": "git+https://github.com/cypress-io/cypress.git"
18
- },
19
- "license": "MIT",
20
- "main": "dist/cypress-svelte.cjs.js",
21
- "module": "dist/cypress-svelte.esm-bundler.js",
22
- "types": "dist/index.d.ts",
23
- "files": [
24
- "dist/**/*"
25
- ],
26
- "scripts": {
27
- "prebuild": "rimraf dist",
28
- "build": "rollup -c rollup.config.mjs",
29
- "postbuild": "node ../../scripts/sync-exported-npm-with-cli.js",
30
- "check-ts": "tsc --noEmit",
31
- "lint": "eslint"
32
- },
33
- "lint-staged": {
34
- "**/*.{js,jsx,ts,tsx,json}": "eslint --fix"
35
- },
36
- "devDependencies": {
37
- "@cypress/mount-utils": "0.0.0-development",
38
- "@packages/eslint-config": "0.0.0-development",
39
- "eslint": "^9.31.0",
40
- "jiti": "^2.4.2",
41
- "rollup": "^4.60.2",
42
- "svelte": "^5.4.0",
43
- "typescript": "~5.4.5"
44
- },
45
- "peerDependencies": {
46
- "cypress": ">=10.6.0",
47
- "svelte": ">=5.0.0"
48
- },
49
- "publishConfig": {
50
- "access": "public"
51
- },
52
- "nx": {
53
- "targets": {
54
- "build": {
55
- "outputs": [
56
- "{workspaceRoot}/cli/svelte",
57
- "{projectRoot}/dist"
58
- ]
59
- }
60
- },
61
- "implicitDependencies": [
62
- "!cypress"
63
- ]
64
- }
65
- }
package/vue/vue/README.md DELETED
@@ -1,14 +0,0 @@
1
- # @cypress/vue
2
-
3
- Mount Vue 3 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 [Vue Component Testing Docs](https://docs.cypress.io/guides/component-testing/vue/overview) for mounting Vue components. Installing and importing `mount` from `@cypress/vue` should only be done for advanced use-cases.
6
- ## Development
7
-
8
- Run `yarn build` to compile and sync packages to the `cypress` cli package.
9
-
10
- Run `yarn cy:open` to open Cypress component testing against real-world examples.
11
-
12
- Run `yarn test` to execute headless Cypress tests.
13
-
14
- ## [Changelog](./CHANGELOG.md)