cypress 16.2.0 → 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 (53) hide show
  1. package/angular/dist/index.js +10 -12
  2. package/angular/package.json +7 -22
  3. package/dist/bin/cypress +8 -8
  4. package/dist/{cli-AgTnS5LO.js → cli-y9Bb9Y77.js} +215 -40
  5. package/dist/cli.js +6 -6
  6. package/dist/{cypress-CdDm9AVa.js → cypress-CvEs5adm.js} +2 -2
  7. package/dist/cypress.js +8 -8
  8. package/dist/exec/spawn.js +4 -4
  9. package/dist/exec/xvfb.js +7 -4
  10. package/dist/index.js +8 -8
  11. package/dist/{spawn-DElwyZHC.js → spawn-Bx99tBTm.js} +529 -69
  12. package/dist/{tap-WHD3nHJC.js → tap-BMFGLoCT.js} +108 -26
  13. package/dist/{xvfb-CbW2_YXR.js → xvfb-DxbcANVl.js} +238 -25
  14. package/mount-utils/dist/index.js +1 -1
  15. package/mount-utils/package.json +15 -14
  16. package/package.json +5 -5
  17. package/react/dist/cypress-react.cjs.js +9 -7
  18. package/react/dist/cypress-react.esm-bundler.js +9 -7
  19. package/react/package.json +26 -46
  20. package/svelte/dist/cypress-svelte.cjs.js +3 -2
  21. package/svelte/dist/cypress-svelte.esm-bundler.js +3 -2
  22. package/svelte/package.json +24 -22
  23. package/types/cy-bluebird.d.ts +1 -0
  24. package/types/cy-chai.d.ts +99 -2
  25. package/types/cypress.d.ts +216 -43
  26. package/types/net-stubbing.d.ts +1 -1
  27. package/vue/dist/cypress-vue.cjs.js +4 -2
  28. package/vue/dist/cypress-vue.esm-bundler.js +4 -2
  29. package/vue/dist/index.d.ts +3 -3
  30. package/vue/package.json +35 -42
  31. package/angular/angular/README.md +0 -18
  32. package/angular/angular/dist/index.d.ts +0 -120
  33. package/angular/angular/dist/index.js +0 -479
  34. package/angular/angular/package.json +0 -82
  35. package/mount-utils/mount-utils/README.md +0 -140
  36. package/mount-utils/mount-utils/dist/index.d.ts +0 -12
  37. package/mount-utils/mount-utils/dist/index.js +0 -41
  38. package/mount-utils/mount-utils/package.json +0 -52
  39. package/react/react/README.md +0 -19
  40. package/react/react/dist/cypress-react.cjs.js +0 -293
  41. package/react/react/dist/cypress-react.esm-bundler.js +0 -268
  42. package/react/react/dist/index.d.ts +0 -95
  43. package/react/react/package.json +0 -113
  44. package/svelte/svelte/README.md +0 -19
  45. package/svelte/svelte/dist/cypress-svelte.cjs.js +0 -122
  46. package/svelte/svelte/dist/cypress-svelte.esm-bundler.js +0 -120
  47. package/svelte/svelte/dist/index.d.ts +0 -31
  48. package/svelte/svelte/package.json +0 -63
  49. package/vue/vue/README.md +0 -14
  50. package/vue/vue/dist/cypress-vue.cjs.js +0 -8692
  51. package/vue/vue/dist/cypress-vue.esm-bundler.js +0 -8671
  52. package/vue/vue/dist/index.d.ts +0 -1413
  53. package/vue/vue/package.json +0 -97
@@ -2,7 +2,29 @@
2
2
  "name": "@cypress/react",
3
3
  "version": "0.0.0-development",
4
4
  "description": "Test React components using Cypress",
5
+ "keywords": [
6
+ "cypress",
7
+ "react",
8
+ "component-testing",
9
+ "react-testing",
10
+ "testing",
11
+ "react-component",
12
+ "jsx"
13
+ ],
14
+ "homepage": "https://github.com/cypress-io/cypress/blob/develop/npm/react/#readme",
15
+ "bugs": "https://github.com/cypress-io/cypress/issues/new?assignees=&labels=npm%3A%20%40cypress%2Freact&template=1-bug-report.md&title=",
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "git+https://github.com/cypress-io/cypress.git"
19
+ },
20
+ "license": "MIT",
5
21
  "main": "dist/cypress-react.cjs.js",
22
+ "unpkg": "dist/cypress-react.browser.js",
23
+ "module": "dist/cypress-react.esm-bundler.js",
24
+ "types": "dist/index.d.ts",
25
+ "files": [
26
+ "dist"
27
+ ],
6
28
  "scripts": {
7
29
  "build": "rimraf dist && rollup -c rollup.config.mjs",
8
30
  "postbuild": "node ../../scripts/sync-exported-npm-with-cli.js",
@@ -15,9 +37,12 @@
15
37
  "test": "yarn cy:run",
16
38
  "watch": "yarn build --watch --watch.exclude ./dist/**/*"
17
39
  },
40
+ "lint-staged": {
41
+ "**/*.{js,jsx,ts,tsx,json}": "eslint --fix"
42
+ },
18
43
  "devDependencies": {
19
- "@packages/eslint-config": "0.0.0-development",
20
44
  "@cypress/mount-utils": "0.0.0-development",
45
+ "@packages/eslint-config": "0.0.0-development",
21
46
  "@testing-library/cypress": "10.1.3",
22
47
  "@vitejs/plugin-react": "4.6.0",
23
48
  "axios": "^1.20.0",
@@ -40,48 +65,6 @@
40
65
  "react": "^18 || ^19",
41
66
  "react-dom": "^18 || ^19"
42
67
  },
43
- "files": [
44
- "dist"
45
- ],
46
- "types": "dist/index.d.ts",
47
- "license": "MIT",
48
- "repository": {
49
- "type": "git",
50
- "url": "https://github.com/cypress-io/cypress.git"
51
- },
52
- "homepage": "https://github.com/cypress-io/cypress/blob/develop/npm/react/#readme",
53
- "bugs": "https://github.com/cypress-io/cypress/issues/new?assignees=&labels=npm%3A%20%40cypress%2Freact&template=1-bug-report.md&title=",
54
- "keywords": [
55
- "react",
56
- "cypress",
57
- "cypress-io",
58
- "test",
59
- "testing"
60
- ],
61
- "contributors": [
62
- {
63
- "name": "Dmitriy Kovalenko",
64
- "social": "@dmtrKovalenko"
65
- },
66
- {
67
- "name": "Brian Mann",
68
- "social": "@brian-mann"
69
- },
70
- {
71
- "name": "Barthélémy Ledoux",
72
- "social": "@elevatebart"
73
- },
74
- {
75
- "name": "Lachlan Miller",
76
- "social": "@lmiller1990"
77
- },
78
- {
79
- "name": "Jessica Sachs",
80
- "social": "@_JessicaSachs"
81
- }
82
- ],
83
- "unpkg": "dist/cypress-react.browser.js",
84
- "module": "dist/cypress-react.esm-bundler.js",
85
68
  "peerDependenciesMeta": {
86
69
  "@types/react": {
87
70
  "optional": true
@@ -106,8 +89,5 @@
106
89
  "cy",
107
90
  "expect"
108
91
  ]
109
- },
110
- "lint-staged": {
111
- "**/*.{js,jsx,ts,tsx}": "eslint --fix"
112
92
  }
113
93
  }
@@ -26,6 +26,7 @@ const getContainerEl = () => {
26
26
  * Utility function to register CT side effects and run cleanup code during the "test:before:run" Cypress hook
27
27
  * @param optionalCallback Callback to be called before the next test runs
28
28
  */
29
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type -- published API; narrowing the parameter would break callers that pass a `Function`
29
30
  function setupHooks(optionalCallback) {
30
31
  // We don't want CT side effects to run when e2e
31
32
  // testing so we early return.
@@ -45,7 +46,6 @@ function setupHooks(optionalCallback) {
45
46
  Cypress.Commands.overwrite('origin', () => {
46
47
  throw new Error('cy.origin from a component spec is not allowed');
47
48
  });
48
- // @ts-ignore
49
49
  Cypress.on('test:before:after:run:async', () => {
50
50
  optionalCallback?.();
51
51
  });
@@ -61,7 +61,7 @@ const cleanup = () => {
61
61
  // Extract the component name from the object passed to mount
62
62
  const getComponentDisplayName = (Component) => {
63
63
  if (Component.name) {
64
- const [, match] = /Proxy\<(\w+)\>/.exec(Component.name) || [];
64
+ const [, match] = /Proxy<(\w+)>/.exec(Component.name) || [];
65
65
  return match || Component.name;
66
66
  }
67
67
  return DEFAULT_COMP_NAME;
@@ -97,6 +97,7 @@ function mount(Component, options = {}) {
97
97
  componentInstance = svelte.mount(ComponentConstructor, Object.assign({ target }, options));
98
98
  // by waiting, we are delaying test execution for the next tick of event loop
99
99
  // and letting hooks and component lifecycle methods to execute mount
100
+ // eslint-disable-next-line cypress/no-unnecessary-waiting -- the zero-length wait is the event-loop tick described above
100
101
  return cy.wait(0, { log: false }).then(() => {
101
102
  if (options.log !== false) {
102
103
  const mountMessage = `<${getComponentDisplayName(Component)} ... />`;
@@ -24,6 +24,7 @@ const getContainerEl = () => {
24
24
  * Utility function to register CT side effects and run cleanup code during the "test:before:run" Cypress hook
25
25
  * @param optionalCallback Callback to be called before the next test runs
26
26
  */
27
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type -- published API; narrowing the parameter would break callers that pass a `Function`
27
28
  function setupHooks(optionalCallback) {
28
29
  // We don't want CT side effects to run when e2e
29
30
  // testing so we early return.
@@ -43,7 +44,6 @@ function setupHooks(optionalCallback) {
43
44
  Cypress.Commands.overwrite('origin', () => {
44
45
  throw new Error('cy.origin from a component spec is not allowed');
45
46
  });
46
- // @ts-ignore
47
47
  Cypress.on('test:before:after:run:async', () => {
48
48
  optionalCallback?.();
49
49
  });
@@ -59,7 +59,7 @@ const cleanup = () => {
59
59
  // Extract the component name from the object passed to mount
60
60
  const getComponentDisplayName = (Component) => {
61
61
  if (Component.name) {
62
- const [, match] = /Proxy\<(\w+)\>/.exec(Component.name) || [];
62
+ const [, match] = /Proxy<(\w+)>/.exec(Component.name) || [];
63
63
  return match || Component.name;
64
64
  }
65
65
  return DEFAULT_COMP_NAME;
@@ -95,6 +95,7 @@ function mount(Component, options = {}) {
95
95
  componentInstance = mount$1(ComponentConstructor, Object.assign({ target }, options));
96
96
  // by waiting, we are delaying test execution for the next tick of event loop
97
97
  // and letting hooks and component lifecycle methods to execute mount
98
+ // eslint-disable-next-line cypress/no-unnecessary-waiting -- the zero-length wait is the event-loop tick described above
98
99
  return cy.wait(0, { log: false }).then(() => {
99
100
  if (options.log !== false) {
100
101
  const mountMessage = `<${getComponentDisplayName(Component)} ... />`;
@@ -2,7 +2,27 @@
2
2
  "name": "@cypress/svelte",
3
3
  "version": "0.0.0-development",
4
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",
5
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
+ ],
6
26
  "scripts": {
7
27
  "prebuild": "rimraf dist",
8
28
  "build": "rollup -c rollup.config.mjs",
@@ -10,9 +30,12 @@
10
30
  "check-ts": "tsc --noEmit",
11
31
  "lint": "eslint"
12
32
  },
33
+ "lint-staged": {
34
+ "**/*.{js,jsx,ts,tsx,json}": "eslint --fix"
35
+ },
13
36
  "devDependencies": {
14
- "@packages/eslint-config": "0.0.0-development",
15
37
  "@cypress/mount-utils": "0.0.0-development",
38
+ "@packages/eslint-config": "0.0.0-development",
16
39
  "eslint": "^9.31.0",
17
40
  "jiti": "^2.4.2",
18
41
  "rollup": "^4.60.2",
@@ -23,24 +46,6 @@
23
46
  "cypress": ">=10.6.0",
24
47
  "svelte": ">=5.0.0"
25
48
  },
26
- "files": [
27
- "dist/**/*"
28
- ],
29
- "types": "dist/index.d.ts",
30
- "license": "MIT",
31
- "repository": {
32
- "type": "git",
33
- "url": "https://github.com/cypress-io/cypress.git"
34
- },
35
- "homepage": "https://github.com/cypress-io/cypress/blob/develop/npm/svelte/#readme",
36
- "bugs": "https://github.com/cypress-io/cypress/issues/new?assignees=&labels=npm%3A%20%40cypress%2Fsvelte&template=1-bug-report.md&title=",
37
- "keywords": [
38
- "cypress",
39
- "svelte",
40
- "testing",
41
- "component testing"
42
- ],
43
- "module": "dist/cypress-svelte.esm-bundler.js",
44
49
  "publishConfig": {
45
50
  "access": "public"
46
51
  },
@@ -56,8 +61,5 @@
56
61
  "implicitDependencies": [
57
62
  "!cypress"
58
63
  ]
59
- },
60
- "lint-staged": {
61
- "**/*.{js,jsx,ts,tsx}": "eslint --fix"
62
64
  }
63
65
  }
@@ -8,5 +8,6 @@ export as namespace Bluebird
8
8
 
9
9
  declare namespace Bluebird {
10
10
  type BluebirdStatic = typeof ImportedBluebird
11
+ // eslint-disable-next-line @typescript-eslint/no-empty-object-type -- public type, an interface so users can augment it
11
12
  interface Promise<T> extends ImportedBluebird<T> {}
12
13
  }
@@ -3,9 +3,36 @@
3
3
  /// <reference path="./chai/index.d.ts" />
4
4
  declare namespace Chai {
5
5
  interface Include {
6
+ /**
7
+ * Assert that the HTML of the first element of the selection contains the given HTML, using `.html()`.
8
+ *
9
+ * @example
10
+ * expect($('#result')).to.contain.html('<em>John Doe</em>')
11
+ * @see http://chaijs.com/plugins/chai-jquery/#htmlhtml
12
+ */
6
13
  html(html: string): Assertion
7
- text(text: string): Assertion
8
- value(text: string): Assertion
14
+
15
+ /**
16
+ * Assert that the text of the selection contains the given text, using `.text()`.
17
+ * A number is compared against the text as a string.
18
+ *
19
+ * @example
20
+ * expect($('#result')).to.contain.text('John')
21
+ * expect($('#count')).to.contain.text(12)
22
+ * @see http://chaijs.com/plugins/chai-jquery/#texttext
23
+ */
24
+ text(text: string | number): Assertion
25
+
26
+ /**
27
+ * Assert that the value of the first element of the selection contains the given value, using `.val()`.
28
+ * A number is compared against the value as a string. Elements whose value is a number,
29
+ * such as `<progress>`, `<meter>`, and `<li>`, never partially match.
30
+ *
31
+ * @example
32
+ * expect($('input')).to.contain.value('red')
33
+ * @see http://chaijs.com/plugins/chai-jquery/#valuevalue
34
+ */
35
+ value(value: string | number): Assertion
9
36
 
10
37
  /**
11
38
  * Asserts that the target contains one of the values in the given list.
@@ -69,5 +96,75 @@ declare namespace Chai {
69
96
  * @see http://chaijs.com/api/bdd/#method_most
70
97
  */
71
98
  lessThanOrEqual: NumberComparer
99
+
100
+ /**
101
+ * Assert that the first element of the selection has the given attribute, using `.attr()`.
102
+ * Optionally, assert a particular value as well. A number is compared against the attribute's string value.
103
+ *
104
+ * @example
105
+ * expect($('#result')).to.have.attr('role', 'menu')
106
+ * expect($('#result')).to.have.attr('tabindex', 0)
107
+ * @see http://chaijs.com/plugins/chai-jquery/#attrname-value
108
+ */
109
+ attr(name: string, value?: string | number): Assertion
110
+
111
+ /**
112
+ * Assert that the first element of the selection has the given data value, using `.data()`.
113
+ * jQuery parses numeric, boolean, and `null` `data-*` attributes into those types, and the value is compared with `===`,
114
+ * so an object or array parsed from JSON never matches.
115
+ *
116
+ * @example
117
+ * expect($('#result')).to.have.data('foo', 'bar')
118
+ * expect($('#result')).to.have.data('count', 3)
119
+ * @see http://chaijs.com/plugins/chai-jquery/#dataname-value
120
+ */
121
+ data(name: string, value?: string | number | boolean | null): Assertion
122
+
123
+ /**
124
+ * Assert that the first element of the selection has the given id, using `.prop('id')`.
125
+ * A number is compared against the id as a string.
126
+ *
127
+ * @example
128
+ * expect($('#result')).to.have.id('result')
129
+ * expect($('#456')).to.have.id(456)
130
+ * @see http://chaijs.com/plugins/chai-jquery/#idid
131
+ */
132
+ id(id: string | number): Assertion
133
+
134
+ /**
135
+ * Assert that the text of the selection equals the given text, using `.text()`.
136
+ * A number is compared against the text as a string.
137
+ *
138
+ * @example
139
+ * expect($('#result')).to.have.text('pending')
140
+ * expect($('#count')).to.have.text(123)
141
+ * @see http://chaijs.com/plugins/chai-jquery/#texttext
142
+ */
143
+ text(text: string | number): Assertion
144
+
145
+ /**
146
+ * Assert that the first element of the selection has the given value, using `.val()`.
147
+ * A number is compared against the value as a string, except for elements whose value is a number: `<progress>`, `<meter>`, and `<li>`.
148
+ *
149
+ * @example
150
+ * expect($('input')).to.have.value('red')
151
+ * expect($('progress')).to.have.value(0.72)
152
+ * @see http://chaijs.com/plugins/chai-jquery/#valuevalue
153
+ */
154
+ value(value: string | number): Assertion
155
+ }
156
+
157
+ interface Match {
158
+ /**
159
+ * Assert that the selection matches the given element, elements, jQuery object, or predicate, using `.is()`.
160
+ * The subject must be a DOM element or jQuery object; any other subject accepts only a regular expression,
161
+ * and a regular expression never matches a DOM element or jQuery object.
162
+ *
163
+ * @example
164
+ * expect($('#result')).to.match($('.menu'))
165
+ * expect($('#result')).to.match((index, element) => element.id === 'result')
166
+ * @see http://chaijs.com/plugins/chai-jquery/#matchselector
167
+ */
168
+ (selector: Cypress.JQueryMatchable): Assertion
72
169
  }
73
170
  }