cypress 9.4.0 → 9.5.1
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +25 -25
- package/bin/cypress +3 -3
- package/lib/cli.js +14 -14
- package/lib/cypress.js +27 -27
- package/lib/errors.js +25 -25
- package/lib/exec/run.js +13 -13
- package/lib/exec/shared.js +8 -8
- package/lib/tasks/cache.js +3 -3
- package/lib/tasks/download.js +7 -7
- package/lib/tasks/get-folder-size.js +8 -8
- package/lib/tasks/install.js +4 -2
- package/lib/tasks/state.js +17 -17
- package/lib/tasks/verify.js +11 -11
- package/lib/util.js +45 -45
- package/package.json +1 -1
- package/types/chai/index.d.ts +5 -5
- package/types/cy-blob-util.d.ts +13 -13
- package/types/cy-bluebird.d.ts +12 -12
- package/types/cy-chai.d.ts +10 -10
- package/types/cy-http.d.ts +13 -13
- package/types/cy-minimatch.d.ts +96 -96
- package/types/cypress-eventemitter.d.ts +33 -33
- package/types/cypress-expect.d.ts +3 -3
- package/types/cypress-global-vars.d.ts +22 -22
- package/types/cypress-npm-api.d.ts +404 -404
- package/types/cypress-type-helpers.d.ts +2 -2
- package/types/cypress.d.ts +5861 -5861
- package/types/index.d.ts +33 -33
- package/types/jquery/JQuery.d.ts +12939 -12939
- package/types/jquery/legacy.d.ts +200 -200
- package/types/jquery/misc.d.ts +6661 -6661
- package/types/minimatch/index.d.ts +0 -0
- package/types/mocha/index.d.ts +2801 -2801
- package/types/net-stubbing.ts +553 -553
package/lib/util.js
CHANGED
@@ -54,11 +54,11 @@ const pkg = require(path.join(__dirname, '..', 'package.json'));
|
|
54
54
|
|
55
55
|
const issuesUrl = 'https://github.com/cypress-io/cypress/issues';
|
56
56
|
const getosAsync = Promise.promisify(getos);
|
57
|
-
/**
|
58
|
-
* Returns SHA512 of a file
|
59
|
-
*
|
60
|
-
* Implementation lifted from https://github.com/sindresorhus/hasha
|
61
|
-
* but without bringing that dependency (since hasha is Node v8+)
|
57
|
+
/**
|
58
|
+
* Returns SHA512 of a file
|
59
|
+
*
|
60
|
+
* Implementation lifted from https://github.com/sindresorhus/hasha
|
61
|
+
* but without bringing that dependency (since hasha is Node v8+)
|
62
62
|
*/
|
63
63
|
|
64
64
|
const getFileChecksum = filename => {
|
@@ -92,21 +92,21 @@ const stringify = val => {
|
|
92
92
|
function normalizeModuleOptions(options = {}) {
|
93
93
|
return _.mapValues(options, stringify);
|
94
94
|
}
|
95
|
-
/**
|
96
|
-
* Returns true if the platform is Linux. We do a lot of different
|
97
|
-
* stuff on Linux (like Xvfb) and it helps to has readable code
|
95
|
+
/**
|
96
|
+
* Returns true if the platform is Linux. We do a lot of different
|
97
|
+
* stuff on Linux (like Xvfb) and it helps to has readable code
|
98
98
|
*/
|
99
99
|
|
100
100
|
|
101
101
|
const isLinux = () => {
|
102
102
|
return os.platform() === 'linux';
|
103
103
|
};
|
104
|
-
/**
|
105
|
-
* If the DISPLAY variable is set incorrectly, when trying to spawn
|
106
|
-
* Cypress executable we get an error like this:
|
107
|
-
```
|
108
|
-
[1005:0509/184205.663837:WARNING:browser_main_loop.cc(258)] Gtk: cannot open display: 99
|
109
|
-
```
|
104
|
+
/**
|
105
|
+
* If the DISPLAY variable is set incorrectly, when trying to spawn
|
106
|
+
* Cypress executable we get an error like this:
|
107
|
+
```
|
108
|
+
[1005:0509/184205.663837:WARNING:browser_main_loop.cc(258)] Gtk: cannot open display: 99
|
109
|
+
```
|
110
110
|
*/
|
111
111
|
|
112
112
|
|
@@ -138,12 +138,12 @@ function stdoutLineMatches(expectedLine, stdout) {
|
|
138
138
|
const lines = stdout.split('\n').map(val => val.trim());
|
139
139
|
return lines.some(line => line === expectedLine);
|
140
140
|
}
|
141
|
-
/**
|
142
|
-
* Confirms if given value is a valid CYPRESS_INTERNAL_ENV value. Undefined values
|
143
|
-
* are valid, because the system can set the default one.
|
144
|
-
*
|
145
|
-
* @param {string} value
|
146
|
-
* @example util.isValidCypressInternalEnvValue(process.env.CYPRESS_INTERNAL_ENV)
|
141
|
+
/**
|
142
|
+
* Confirms if given value is a valid CYPRESS_INTERNAL_ENV value. Undefined values
|
143
|
+
* are valid, because the system can set the default one.
|
144
|
+
*
|
145
|
+
* @param {string} value
|
146
|
+
* @example util.isValidCypressInternalEnvValue(process.env.CYPRESS_INTERNAL_ENV)
|
147
147
|
*/
|
148
148
|
|
149
149
|
|
@@ -157,21 +157,21 @@ function isValidCypressInternalEnvValue(value) {
|
|
157
157
|
const names = ['development', 'test', 'staging', 'production'];
|
158
158
|
return _.includes(names, value);
|
159
159
|
}
|
160
|
-
/**
|
161
|
-
* Confirms if given value is a non-production CYPRESS_INTERNAL_ENV value.
|
162
|
-
* Undefined values are valid, because the system can set the default one.
|
163
|
-
*
|
164
|
-
* @param {string} value
|
165
|
-
* @example util.isNonProductionCypressInternalEnvValue(process.env.CYPRESS_INTERNAL_ENV)
|
160
|
+
/**
|
161
|
+
* Confirms if given value is a non-production CYPRESS_INTERNAL_ENV value.
|
162
|
+
* Undefined values are valid, because the system can set the default one.
|
163
|
+
*
|
164
|
+
* @param {string} value
|
165
|
+
* @example util.isNonProductionCypressInternalEnvValue(process.env.CYPRESS_INTERNAL_ENV)
|
166
166
|
*/
|
167
167
|
|
168
168
|
|
169
169
|
function isNonProductionCypressInternalEnvValue(value) {
|
170
170
|
return !_.isUndefined(value) && value !== 'production';
|
171
171
|
}
|
172
|
-
/**
|
173
|
-
* Prints NODE_OPTIONS using debug() module, but only
|
174
|
-
* if DEBUG=cypress... is set
|
172
|
+
/**
|
173
|
+
* Prints NODE_OPTIONS using debug() module, but only
|
174
|
+
* if DEBUG=cypress... is set
|
175
175
|
*/
|
176
176
|
|
177
177
|
|
@@ -186,19 +186,19 @@ function printNodeOptions(log = debug) {
|
|
186
186
|
log('NODE_OPTIONS is not set');
|
187
187
|
}
|
188
188
|
}
|
189
|
-
/**
|
190
|
-
* Removes double quote characters
|
191
|
-
* from the start and end of the given string IF they are both present
|
192
|
-
*
|
193
|
-
* @param {string} str Input string
|
194
|
-
* @returns {string} Trimmed string or the original string if there are no double quotes around it.
|
195
|
-
* @example
|
196
|
-
```
|
197
|
-
dequote('"foo"')
|
198
|
-
// returns string 'foo'
|
199
|
-
dequote('foo')
|
200
|
-
// returns string 'foo'
|
201
|
-
```
|
189
|
+
/**
|
190
|
+
* Removes double quote characters
|
191
|
+
* from the start and end of the given string IF they are both present
|
192
|
+
*
|
193
|
+
* @param {string} str Input string
|
194
|
+
* @returns {string} Trimmed string or the original string if there are no double quotes around it.
|
195
|
+
* @example
|
196
|
+
```
|
197
|
+
dequote('"foo"')
|
198
|
+
// returns string 'foo'
|
199
|
+
dequote('foo')
|
200
|
+
// returns string 'foo'
|
201
|
+
```
|
202
202
|
*/
|
203
203
|
|
204
204
|
|
@@ -234,9 +234,9 @@ const parseOpts = opts => {
|
|
234
234
|
debug('parsed cli options %o', cleanOpts);
|
235
235
|
return cleanOpts;
|
236
236
|
};
|
237
|
-
/**
|
238
|
-
* Copy of packages/server/lib/browsers/utils.ts
|
239
|
-
* because we need same functionality in CLI to show the path :(
|
237
|
+
/**
|
238
|
+
* Copy of packages/server/lib/browsers/utils.ts
|
239
|
+
* because we need same functionality in CLI to show the path :(
|
240
240
|
*/
|
241
241
|
|
242
242
|
|
package/package.json
CHANGED
package/types/chai/index.d.ts
CHANGED
@@ -1949,8 +1949,8 @@ declare module "chai" {
|
|
1949
1949
|
export = chai;
|
1950
1950
|
}
|
1951
1951
|
|
1952
|
-
// const a = 1; a.should(1); doesn't work with Cypress
|
1953
|
-
// https://github.com/cypress-io/cypress/issues/16548
|
1954
|
-
// interface Object {
|
1955
|
-
// should: Chai.Assertion;
|
1956
|
-
// }
|
1952
|
+
// const a = 1; a.should(1); doesn't work with Cypress
|
1953
|
+
// https://github.com/cypress-io/cypress/issues/16548
|
1954
|
+
// interface Object {
|
1955
|
+
// should: Chai.Assertion;
|
1956
|
+
// }
|
package/types/cy-blob-util.d.ts
CHANGED
@@ -1,13 +1,13 @@
|
|
1
|
-
// Shim definition to export a namespace. Cypress is actually a global module
|
2
|
-
// so import/export isn't allowed there. We import here and define a global module
|
3
|
-
// so that Cypress can get and use the Blob type
|
4
|
-
|
5
|
-
// tslint:disable-next-line:no-implicit-dependencies
|
6
|
-
import * as blobUtil from 'blob-util'
|
7
|
-
|
8
|
-
export = BlobUtil
|
9
|
-
export as namespace BlobUtil
|
10
|
-
|
11
|
-
declare namespace BlobUtil {
|
12
|
-
type BlobUtilStatic = typeof blobUtil
|
13
|
-
}
|
1
|
+
// Shim definition to export a namespace. Cypress is actually a global module
|
2
|
+
// so import/export isn't allowed there. We import here and define a global module
|
3
|
+
// so that Cypress can get and use the Blob type
|
4
|
+
|
5
|
+
// tslint:disable-next-line:no-implicit-dependencies
|
6
|
+
import * as blobUtil from 'blob-util'
|
7
|
+
|
8
|
+
export = BlobUtil
|
9
|
+
export as namespace BlobUtil
|
10
|
+
|
11
|
+
declare namespace BlobUtil {
|
12
|
+
type BlobUtilStatic = typeof blobUtil
|
13
|
+
}
|
package/types/cy-bluebird.d.ts
CHANGED
@@ -1,12 +1,12 @@
|
|
1
|
-
// Shim definition to export a namespace. Cypress is actually a global module
|
2
|
-
// so import/export isn't allowed there. We import here and define a global module
|
3
|
-
// so that Cypress can get and use the Blob type
|
4
|
-
import ImportedBluebird = require('./bluebird')
|
5
|
-
|
6
|
-
export = Bluebird
|
7
|
-
export as namespace Bluebird
|
8
|
-
|
9
|
-
declare namespace Bluebird {
|
10
|
-
type BluebirdStatic = typeof ImportedBluebird
|
11
|
-
interface Promise<T> extends ImportedBluebird<T> {}
|
12
|
-
}
|
1
|
+
// Shim definition to export a namespace. Cypress is actually a global module
|
2
|
+
// so import/export isn't allowed there. We import here and define a global module
|
3
|
+
// so that Cypress can get and use the Blob type
|
4
|
+
import ImportedBluebird = require('./bluebird')
|
5
|
+
|
6
|
+
export = Bluebird
|
7
|
+
export as namespace Bluebird
|
8
|
+
|
9
|
+
declare namespace Bluebird {
|
10
|
+
type BluebirdStatic = typeof ImportedBluebird
|
11
|
+
interface Promise<T> extends ImportedBluebird<T> {}
|
12
|
+
}
|
package/types/cy-chai.d.ts
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
// Shim definition to export a namespace. Cypress is actually a global module
|
2
|
-
// so import/export isn't allowed there. We import here and define a global module
|
3
|
-
/// <reference path="./chai/index.d.ts" />
|
4
|
-
declare namespace Chai {
|
5
|
-
interface Include {
|
6
|
-
html(html: string): Assertion
|
7
|
-
text(text: string): Assertion
|
8
|
-
value(text: string): Assertion
|
9
|
-
}
|
10
|
-
}
|
1
|
+
// Shim definition to export a namespace. Cypress is actually a global module
|
2
|
+
// so import/export isn't allowed there. We import here and define a global module
|
3
|
+
/// <reference path="./chai/index.d.ts" />
|
4
|
+
declare namespace Chai {
|
5
|
+
interface Include {
|
6
|
+
html(html: string): Assertion
|
7
|
+
text(text: string): Assertion
|
8
|
+
value(text: string): Assertion
|
9
|
+
}
|
10
|
+
}
|
package/types/cy-http.d.ts
CHANGED
@@ -1,13 +1,13 @@
|
|
1
|
-
/**
|
2
|
-
* This file should be deleted as soon as the serever
|
3
|
-
* TODO: delete this file when ResolvedDevServerConfig.server is converted to closeServer
|
4
|
-
*/
|
5
|
-
|
6
|
-
/// <reference types="node" />
|
7
|
-
import * as cyUtilsHttp from 'http'
|
8
|
-
export = cyUtilsHttp
|
9
|
-
/**
|
10
|
-
* namespace created to bridge nodeJs.http typings so that
|
11
|
-
* we can type http Server in CT
|
12
|
-
*/
|
13
|
-
export as namespace cyUtilsHttp
|
1
|
+
/**
|
2
|
+
* This file should be deleted as soon as the serever
|
3
|
+
* TODO: delete this file when ResolvedDevServerConfig.server is converted to closeServer
|
4
|
+
*/
|
5
|
+
|
6
|
+
/// <reference types="node" />
|
7
|
+
import * as cyUtilsHttp from 'http'
|
8
|
+
export = cyUtilsHttp
|
9
|
+
/**
|
10
|
+
* namespace created to bridge nodeJs.http typings so that
|
11
|
+
* we can type http Server in CT
|
12
|
+
*/
|
13
|
+
export as namespace cyUtilsHttp
|
package/types/cy-minimatch.d.ts
CHANGED
@@ -1,96 +1,96 @@
|
|
1
|
-
// I was trying to avoid relying on "import" of actual module from "minimatch"
|
2
|
-
// because it would not work in test project, and the only reliable way
|
3
|
-
// to get around type errors finally was to copy the minimal minimatch function
|
4
|
-
// definition from "minimatch/index.d.ts" here and just keep it in our code
|
5
|
-
|
6
|
-
export = Minimatch
|
7
|
-
export as namespace Minimatch
|
8
|
-
|
9
|
-
interface MinimatchOptions {
|
10
|
-
/**
|
11
|
-
* Dump a ton of stuff to stderr.
|
12
|
-
*
|
13
|
-
* @default false
|
14
|
-
*/
|
15
|
-
debug?: boolean
|
16
|
-
|
17
|
-
/**
|
18
|
-
* Do not expand {a,b} and {1..3} brace sets.
|
19
|
-
*
|
20
|
-
* @default false
|
21
|
-
*/
|
22
|
-
nobrace?: boolean
|
23
|
-
|
24
|
-
/**
|
25
|
-
* Disable ** matching against multiple folder names.
|
26
|
-
*
|
27
|
-
* @default false
|
28
|
-
*/
|
29
|
-
noglobstar?: boolean
|
30
|
-
|
31
|
-
/**
|
32
|
-
* Allow patterns to match filenames starting with a period,
|
33
|
-
* even if the pattern does not explicitly have a period in that spot.
|
34
|
-
*
|
35
|
-
* @default false
|
36
|
-
*/
|
37
|
-
dot?: boolean
|
38
|
-
|
39
|
-
/**
|
40
|
-
* Disable "extglob" style patterns like +(a|b).
|
41
|
-
*
|
42
|
-
* @default false
|
43
|
-
*/
|
44
|
-
noext?: boolean
|
45
|
-
|
46
|
-
/**
|
47
|
-
* Perform a case-insensitive match.
|
48
|
-
*
|
49
|
-
* @default false
|
50
|
-
*/
|
51
|
-
nocase?: boolean
|
52
|
-
|
53
|
-
/**
|
54
|
-
* When a match is not found by minimatch.match,
|
55
|
-
* return a list containing the pattern itself if this option is set.
|
56
|
-
* Otherwise, an empty list is returned if there are no matches.
|
57
|
-
*
|
58
|
-
* @default false
|
59
|
-
*/
|
60
|
-
nonull?: boolean
|
61
|
-
|
62
|
-
/**
|
63
|
-
* If set, then patterns without slashes will be matched against
|
64
|
-
* the basename of the path if it contains slashes.
|
65
|
-
*
|
66
|
-
* @default false
|
67
|
-
*/
|
68
|
-
matchBase?: boolean
|
69
|
-
|
70
|
-
/**
|
71
|
-
* Suppress the behavior of treating #
|
72
|
-
* at the start of a pattern as a comment.
|
73
|
-
*
|
74
|
-
* @default false
|
75
|
-
*/
|
76
|
-
nocomment?: boolean
|
77
|
-
|
78
|
-
/**
|
79
|
-
* Suppress the behavior of treating a leading ! character as negation.
|
80
|
-
*
|
81
|
-
* @default false
|
82
|
-
*/
|
83
|
-
nonegate?: boolean
|
84
|
-
|
85
|
-
/**
|
86
|
-
* Returns from negate expressions the same as if they were not negated.
|
87
|
-
* (Ie, true on a hit, false on a miss.)
|
88
|
-
*
|
89
|
-
* @default false
|
90
|
-
*/
|
91
|
-
flipNegate?: boolean
|
92
|
-
}
|
93
|
-
|
94
|
-
declare namespace Minimatch {
|
95
|
-
function minimatch(target: string, pattern: string, options?: MinimatchOptions): boolean
|
96
|
-
}
|
1
|
+
// I was trying to avoid relying on "import" of actual module from "minimatch"
|
2
|
+
// because it would not work in test project, and the only reliable way
|
3
|
+
// to get around type errors finally was to copy the minimal minimatch function
|
4
|
+
// definition from "minimatch/index.d.ts" here and just keep it in our code
|
5
|
+
|
6
|
+
export = Minimatch
|
7
|
+
export as namespace Minimatch
|
8
|
+
|
9
|
+
interface MinimatchOptions {
|
10
|
+
/**
|
11
|
+
* Dump a ton of stuff to stderr.
|
12
|
+
*
|
13
|
+
* @default false
|
14
|
+
*/
|
15
|
+
debug?: boolean
|
16
|
+
|
17
|
+
/**
|
18
|
+
* Do not expand {a,b} and {1..3} brace sets.
|
19
|
+
*
|
20
|
+
* @default false
|
21
|
+
*/
|
22
|
+
nobrace?: boolean
|
23
|
+
|
24
|
+
/**
|
25
|
+
* Disable ** matching against multiple folder names.
|
26
|
+
*
|
27
|
+
* @default false
|
28
|
+
*/
|
29
|
+
noglobstar?: boolean
|
30
|
+
|
31
|
+
/**
|
32
|
+
* Allow patterns to match filenames starting with a period,
|
33
|
+
* even if the pattern does not explicitly have a period in that spot.
|
34
|
+
*
|
35
|
+
* @default false
|
36
|
+
*/
|
37
|
+
dot?: boolean
|
38
|
+
|
39
|
+
/**
|
40
|
+
* Disable "extglob" style patterns like +(a|b).
|
41
|
+
*
|
42
|
+
* @default false
|
43
|
+
*/
|
44
|
+
noext?: boolean
|
45
|
+
|
46
|
+
/**
|
47
|
+
* Perform a case-insensitive match.
|
48
|
+
*
|
49
|
+
* @default false
|
50
|
+
*/
|
51
|
+
nocase?: boolean
|
52
|
+
|
53
|
+
/**
|
54
|
+
* When a match is not found by minimatch.match,
|
55
|
+
* return a list containing the pattern itself if this option is set.
|
56
|
+
* Otherwise, an empty list is returned if there are no matches.
|
57
|
+
*
|
58
|
+
* @default false
|
59
|
+
*/
|
60
|
+
nonull?: boolean
|
61
|
+
|
62
|
+
/**
|
63
|
+
* If set, then patterns without slashes will be matched against
|
64
|
+
* the basename of the path if it contains slashes.
|
65
|
+
*
|
66
|
+
* @default false
|
67
|
+
*/
|
68
|
+
matchBase?: boolean
|
69
|
+
|
70
|
+
/**
|
71
|
+
* Suppress the behavior of treating #
|
72
|
+
* at the start of a pattern as a comment.
|
73
|
+
*
|
74
|
+
* @default false
|
75
|
+
*/
|
76
|
+
nocomment?: boolean
|
77
|
+
|
78
|
+
/**
|
79
|
+
* Suppress the behavior of treating a leading ! character as negation.
|
80
|
+
*
|
81
|
+
* @default false
|
82
|
+
*/
|
83
|
+
nonegate?: boolean
|
84
|
+
|
85
|
+
/**
|
86
|
+
* Returns from negate expressions the same as if they were not negated.
|
87
|
+
* (Ie, true on a hit, false on a miss.)
|
88
|
+
*
|
89
|
+
* @default false
|
90
|
+
*/
|
91
|
+
flipNegate?: boolean
|
92
|
+
}
|
93
|
+
|
94
|
+
declare namespace Minimatch {
|
95
|
+
function minimatch(target: string, pattern: string, options?: MinimatchOptions): boolean
|
96
|
+
}
|
@@ -1,33 +1,33 @@
|
|
1
|
-
// Cypress, cy, Log inherits EventEmitter.
|
2
|
-
type EventEmitter2 = import("eventemitter2").EventEmitter2
|
3
|
-
|
4
|
-
interface EventEmitter extends EventEmitter2 {
|
5
|
-
proxyTo: (cy: Cypress.cy) => null
|
6
|
-
emitMap: (eventName: string, args: any[]) => Array<(...args: any[]) => any>
|
7
|
-
emitThen: (eventName: string, args: any[]) => Bluebird.BluebirdStatic
|
8
|
-
}
|
9
|
-
|
10
|
-
// Copied from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/node/events.d.ts
|
11
|
-
// to avoid type conflict.
|
12
|
-
interface NodeEventEmitter {
|
13
|
-
addListener(event: string | symbol, listener: (...args: any[]) => void): this
|
14
|
-
on(event: string | symbol, listener: (...args: any[]) => void): this
|
15
|
-
once(event: string | symbol, listener: (...args: any[]) => void): this
|
16
|
-
removeListener(event: string | symbol, listener: (...args: any[]) => void): this
|
17
|
-
off(event: string | symbol, listener: (...args: any[]) => void): this
|
18
|
-
removeAllListeners(event?: string | symbol): this
|
19
|
-
setMaxListeners(n: number): this
|
20
|
-
getMaxListeners(): number
|
21
|
-
listeners(event: string | symbol): Array<(...args: any[]) => void>
|
22
|
-
rawListeners(event: string | symbol): Array<(...args: any[]) => void>
|
23
|
-
emit(event: string | symbol, ...args: any[]): boolean
|
24
|
-
listenerCount(type: string | symbol): number
|
25
|
-
// Added in Node 6...
|
26
|
-
prependListener(event: string | symbol, listener: (...args: any[]) => void): this
|
27
|
-
prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this
|
28
|
-
eventNames(): Array<string | symbol>
|
29
|
-
}
|
30
|
-
|
31
|
-
// We use the Buffer class for dealing with binary data, especially around the
|
32
|
-
// selectFile interface.
|
33
|
-
type BufferType = import("buffer/").Buffer
|
1
|
+
// Cypress, cy, Log inherits EventEmitter.
|
2
|
+
type EventEmitter2 = import("eventemitter2").EventEmitter2
|
3
|
+
|
4
|
+
interface EventEmitter extends EventEmitter2 {
|
5
|
+
proxyTo: (cy: Cypress.cy) => null
|
6
|
+
emitMap: (eventName: string, args: any[]) => Array<(...args: any[]) => any>
|
7
|
+
emitThen: (eventName: string, args: any[]) => Bluebird.BluebirdStatic
|
8
|
+
}
|
9
|
+
|
10
|
+
// Copied from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/node/events.d.ts
|
11
|
+
// to avoid type conflict.
|
12
|
+
interface NodeEventEmitter {
|
13
|
+
addListener(event: string | symbol, listener: (...args: any[]) => void): this
|
14
|
+
on(event: string | symbol, listener: (...args: any[]) => void): this
|
15
|
+
once(event: string | symbol, listener: (...args: any[]) => void): this
|
16
|
+
removeListener(event: string | symbol, listener: (...args: any[]) => void): this
|
17
|
+
off(event: string | symbol, listener: (...args: any[]) => void): this
|
18
|
+
removeAllListeners(event?: string | symbol): this
|
19
|
+
setMaxListeners(n: number): this
|
20
|
+
getMaxListeners(): number
|
21
|
+
listeners(event: string | symbol): Array<(...args: any[]) => void>
|
22
|
+
rawListeners(event: string | symbol): Array<(...args: any[]) => void>
|
23
|
+
emit(event: string | symbol, ...args: any[]): boolean
|
24
|
+
listenerCount(type: string | symbol): number
|
25
|
+
// Added in Node 6...
|
26
|
+
prependListener(event: string | symbol, listener: (...args: any[]) => void): this
|
27
|
+
prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this
|
28
|
+
eventNames(): Array<string | symbol>
|
29
|
+
}
|
30
|
+
|
31
|
+
// We use the Buffer class for dealing with binary data, especially around the
|
32
|
+
// selectFile interface.
|
33
|
+
type BufferType = import("buffer/").Buffer
|
@@ -1,3 +1,3 @@
|
|
1
|
-
// Cypress adds chai expect and assert to global
|
2
|
-
declare const expect: Chai.ExpectStatic
|
3
|
-
declare const assert: Chai.AssertStatic
|
1
|
+
// Cypress adds chai expect and assert to global
|
2
|
+
declare const expect: Chai.ExpectStatic
|
3
|
+
declare const assert: Chai.AssertStatic
|
@@ -1,22 +1,22 @@
|
|
1
|
-
/**
|
2
|
-
* Global variables `cy` added by Cypress with all API commands.
|
3
|
-
* @see https://on.cypress.io/api
|
4
|
-
*
|
5
|
-
```
|
6
|
-
cy.get('button').click()
|
7
|
-
cy.get('.result').contains('Expected text')
|
8
|
-
```
|
9
|
-
*/
|
10
|
-
declare const cy: Cypress.cy & EventEmitter
|
11
|
-
|
12
|
-
/**
|
13
|
-
* Global variable `Cypress` holds common utilities and constants.
|
14
|
-
* @see https://on.cypress.io/api
|
15
|
-
*
|
16
|
-
```
|
17
|
-
Cypress.config("pageLoadTimeout") // => 60000
|
18
|
-
Cypress.version // => "1.4.0"
|
19
|
-
Cypress._ // => Lodash _
|
20
|
-
```
|
21
|
-
*/
|
22
|
-
declare const Cypress: Cypress.Cypress & EventEmitter
|
1
|
+
/**
|
2
|
+
* Global variables `cy` added by Cypress with all API commands.
|
3
|
+
* @see https://on.cypress.io/api
|
4
|
+
*
|
5
|
+
```
|
6
|
+
cy.get('button').click()
|
7
|
+
cy.get('.result').contains('Expected text')
|
8
|
+
```
|
9
|
+
*/
|
10
|
+
declare const cy: Cypress.cy & EventEmitter
|
11
|
+
|
12
|
+
/**
|
13
|
+
* Global variable `Cypress` holds common utilities and constants.
|
14
|
+
* @see https://on.cypress.io/api
|
15
|
+
*
|
16
|
+
```
|
17
|
+
Cypress.config("pageLoadTimeout") // => 60000
|
18
|
+
Cypress.version // => "1.4.0"
|
19
|
+
Cypress._ // => Lodash _
|
20
|
+
```
|
21
|
+
*/
|
22
|
+
declare const Cypress: Cypress.Cypress & EventEmitter
|