cypress 16.2.0 → 16.2.1

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 (38) hide show
  1. package/angular/angular/dist/index.js +6 -7
  2. package/angular/angular/package.json +7 -22
  3. package/angular/dist/index.js +6 -7
  4. package/angular/package.json +7 -22
  5. package/dist/bin/cypress +2 -2
  6. package/dist/{cli-AgTnS5LO.js → cli-DoJnc1F1.js} +6 -5
  7. package/dist/cli.js +2 -2
  8. package/dist/{cypress-CdDm9AVa.js → cypress-BTgp4zGi.js} +1 -1
  9. package/dist/cypress.js +3 -3
  10. package/dist/exec/spawn.js +1 -1
  11. package/dist/index.js +3 -3
  12. package/dist/{spawn-DElwyZHC.js → spawn-zPuxj7Kz.js} +2 -2
  13. package/dist/{tap-WHD3nHJC.js → tap-D2mHgoNE.js} +2 -2
  14. package/mount-utils/dist/index.js +0 -1
  15. package/mount-utils/mount-utils/dist/index.js +0 -1
  16. package/mount-utils/mount-utils/package.json +14 -14
  17. package/mount-utils/package.json +14 -14
  18. package/package.json +4 -4
  19. package/react/dist/cypress-react.cjs.js +5 -6
  20. package/react/dist/cypress-react.esm-bundler.js +5 -6
  21. package/react/package.json +26 -46
  22. package/react/react/dist/cypress-react.cjs.js +5 -6
  23. package/react/react/dist/cypress-react.esm-bundler.js +5 -6
  24. package/react/react/package.json +26 -46
  25. package/svelte/dist/cypress-svelte.cjs.js +0 -1
  26. package/svelte/dist/cypress-svelte.esm-bundler.js +0 -1
  27. package/svelte/package.json +24 -22
  28. package/svelte/svelte/dist/cypress-svelte.cjs.js +0 -1
  29. package/svelte/svelte/dist/cypress-svelte.esm-bundler.js +0 -1
  30. package/svelte/svelte/package.json +24 -22
  31. package/types/cy-chai.d.ts +99 -2
  32. package/types/cypress.d.ts +208 -42
  33. package/vue/dist/cypress-vue.cjs.js +1 -2
  34. package/vue/dist/cypress-vue.esm-bundler.js +1 -2
  35. package/vue/package.json +35 -42
  36. package/vue/vue/dist/cypress-vue.cjs.js +1 -2
  37. package/vue/vue/dist/cypress-vue.esm-bundler.js +1 -2
  38. package/vue/vue/package.json +35 -42
@@ -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
  }
@@ -102,7 +102,6 @@ function setupHooks(optionalCallback) {
102
102
  Cypress.Commands.overwrite('origin', () => {
103
103
  throw new Error('cy.origin from a component spec is not allowed');
104
104
  });
105
- // @ts-ignore
106
105
  Cypress.on('test:before:after:run:async', () => {
107
106
  optionalCallback?.();
108
107
  });
@@ -134,7 +133,7 @@ const makeMountFn = (type, jsx, options = {}, rerenderKey, internalMountOptions)
134
133
  ].join(' '));
135
134
  }
136
135
  const key = rerenderKey !== null && rerenderKey !== void 0 ? rerenderKey :
137
- // @ts-ignore provide unique key to the the wrapped component to make sure we are rerendering between tests
136
+ // @ts-expect-error - `mocha` is not in the public Cypress types. Provide unique key to the wrapped component to make sure we are rerendering between tests
138
137
  (((_c = (_b = (_a = Cypress === null || Cypress === void 0 ? void 0 : Cypress.mocha) === null || _a === void 0 ? void 0 : _a.getRunner()) === null || _b === void 0 ? void 0 : _b.test) === null || _c === void 0 ? void 0 : _c.title) || '') + Math.random();
139
138
  const props = {
140
139
  key,
@@ -158,18 +157,18 @@ const makeMountFn = (type, jsx, options = {}, rerenderKey, internalMountOptions)
158
157
  .then(() => {
159
158
  if (options.log !== false) {
160
159
  // Get the display name property via the component constructor
161
- // @ts-ignore FIXME
162
160
  const componentName = getDisplayName(jsx);
163
161
  const jsxComponentName = `<${componentName} ... />`;
164
162
  Cypress.log({
165
163
  name: type,
166
164
  type: 'parent',
167
165
  message: [jsxComponentName],
168
- // @ts-ignore
166
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment -- @ts-expect-error would be unused once the cli typedefs are generated
167
+ // @ts-ignore - JQuery comes from cli/types/jquery, which is generated by the cli build and missing when this package builds first
169
168
  $el: el.children.item(0),
170
169
  consoleProps: () => {
171
170
  return {
172
- // @ts-ignore protect the use of jsx functional components use ReactNode
171
+ // @ts-expect-error - `props` is not on every `ReactNode` member, such as string
173
172
  props: jsx === null || jsx === void 0 ? void 0 : jsx.props,
174
173
  description: type === 'mount' ? 'Mounts React component' : 'Rerenders mounted React component',
175
174
  home: 'https://github.com/cypress-io/cypress',
@@ -232,7 +231,7 @@ const createMount = (defaultOptions) => {
232
231
  // Note: This would be a breaking change
233
232
  // it is required to unmount component in beforeEach hook in order to provide a clean state inside test
234
233
  // because `mount` can be called after some preparation that can side effect unmount
235
- // @see npm/react/cypress/component/advanced/set-timeout-example/loading-indicator-spec.js
234
+ // @see npm/react/cypress/component/advanced/set-timeout-example/loading-indicator.cy.tsx
236
235
  setupHooks(preMountCleanup);
237
236
 
238
237
  let root;
@@ -81,7 +81,6 @@ function setupHooks(optionalCallback) {
81
81
  Cypress.Commands.overwrite('origin', () => {
82
82
  throw new Error('cy.origin from a component spec is not allowed');
83
83
  });
84
- // @ts-ignore
85
84
  Cypress.on('test:before:after:run:async', () => {
86
85
  optionalCallback?.();
87
86
  });
@@ -113,7 +112,7 @@ const makeMountFn = (type, jsx, options = {}, rerenderKey, internalMountOptions)
113
112
  ].join(' '));
114
113
  }
115
114
  const key = rerenderKey !== null && rerenderKey !== void 0 ? rerenderKey :
116
- // @ts-ignore provide unique key to the the wrapped component to make sure we are rerendering between tests
115
+ // @ts-expect-error - `mocha` is not in the public Cypress types. Provide unique key to the wrapped component to make sure we are rerendering between tests
117
116
  (((_c = (_b = (_a = Cypress === null || Cypress === void 0 ? void 0 : Cypress.mocha) === null || _a === void 0 ? void 0 : _a.getRunner()) === null || _b === void 0 ? void 0 : _b.test) === null || _c === void 0 ? void 0 : _c.title) || '') + Math.random();
118
117
  const props = {
119
118
  key,
@@ -137,18 +136,18 @@ const makeMountFn = (type, jsx, options = {}, rerenderKey, internalMountOptions)
137
136
  .then(() => {
138
137
  if (options.log !== false) {
139
138
  // Get the display name property via the component constructor
140
- // @ts-ignore FIXME
141
139
  const componentName = getDisplayName(jsx);
142
140
  const jsxComponentName = `<${componentName} ... />`;
143
141
  Cypress.log({
144
142
  name: type,
145
143
  type: 'parent',
146
144
  message: [jsxComponentName],
147
- // @ts-ignore
145
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment -- @ts-expect-error would be unused once the cli typedefs are generated
146
+ // @ts-ignore - JQuery comes from cli/types/jquery, which is generated by the cli build and missing when this package builds first
148
147
  $el: el.children.item(0),
149
148
  consoleProps: () => {
150
149
  return {
151
- // @ts-ignore protect the use of jsx functional components use ReactNode
150
+ // @ts-expect-error - `props` is not on every `ReactNode` member, such as string
152
151
  props: jsx === null || jsx === void 0 ? void 0 : jsx.props,
153
152
  description: type === 'mount' ? 'Mounts React component' : 'Rerenders mounted React component',
154
153
  home: 'https://github.com/cypress-io/cypress',
@@ -211,7 +210,7 @@ const createMount = (defaultOptions) => {
211
210
  // Note: This would be a breaking change
212
211
  // it is required to unmount component in beforeEach hook in order to provide a clean state inside test
213
212
  // because `mount` can be called after some preparation that can side effect unmount
214
- // @see npm/react/cypress/component/advanced/set-timeout-example/loading-indicator-spec.js
213
+ // @see npm/react/cypress/component/advanced/set-timeout-example/loading-indicator.cy.tsx
215
214
  setupHooks(preMountCleanup);
216
215
 
217
216
  let root;
@@ -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
  }
@@ -45,7 +45,6 @@ function setupHooks(optionalCallback) {
45
45
  Cypress.Commands.overwrite('origin', () => {
46
46
  throw new Error('cy.origin from a component spec is not allowed');
47
47
  });
48
- // @ts-ignore
49
48
  Cypress.on('test:before:after:run:async', () => {
50
49
  optionalCallback?.();
51
50
  });
@@ -43,7 +43,6 @@ function setupHooks(optionalCallback) {
43
43
  Cypress.Commands.overwrite('origin', () => {
44
44
  throw new Error('cy.origin from a component spec is not allowed');
45
45
  });
46
- // @ts-ignore
47
46
  Cypress.on('test:before:after:run:async', () => {
48
47
  optionalCallback?.();
49
48
  });
@@ -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
  }
@@ -45,7 +45,6 @@ function setupHooks(optionalCallback) {
45
45
  Cypress.Commands.overwrite('origin', () => {
46
46
  throw new Error('cy.origin from a component spec is not allowed');
47
47
  });
48
- // @ts-ignore
49
48
  Cypress.on('test:before:after:run:async', () => {
50
49
  optionalCallback?.();
51
50
  });
@@ -43,7 +43,6 @@ function setupHooks(optionalCallback) {
43
43
  Cypress.Commands.overwrite('origin', () => {
44
44
  throw new Error('cy.origin from a component spec is not allowed');
45
45
  });
46
- // @ts-ignore
47
46
  Cypress.on('test:before:after:run:async', () => {
48
47
  optionalCallback?.();
49
48
  });
@@ -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
  }
@@ -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
  }