cypress 15.1.0 → 15.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/bin/cypress +3 -1
  2. package/dist/VerboseRenderer.js +61 -0
  3. package/dist/cli.js +544 -0
  4. package/dist/cypress.js +104 -0
  5. package/dist/errors.js +391 -0
  6. package/dist/exec/info.js +103 -0
  7. package/dist/exec/open.js +103 -0
  8. package/dist/exec/run.js +177 -0
  9. package/dist/exec/shared.js +55 -0
  10. package/dist/exec/spawn.js +301 -0
  11. package/dist/exec/versions.js +67 -0
  12. package/dist/exec/xvfb.js +118 -0
  13. package/dist/index.js +52 -0
  14. package/dist/index.mjs +9 -0
  15. package/dist/logger.js +55 -0
  16. package/dist/tasks/cache.js +144 -0
  17. package/dist/tasks/download.js +304 -0
  18. package/dist/tasks/get-folder-size.js +44 -0
  19. package/dist/tasks/install.js +326 -0
  20. package/dist/tasks/state.js +184 -0
  21. package/dist/tasks/unzip.js +192 -0
  22. package/dist/tasks/verify.js +303 -0
  23. package/dist/util.js +452 -0
  24. package/package.json +10 -13
  25. package/types/cypress-automation.d.ts +2 -1
  26. package/types/cypress.d.ts +1 -0
  27. package/index.js +0 -27
  28. package/index.mjs +0 -17
  29. package/lib/VerboseRenderer.js +0 -58
  30. package/lib/cli.js +0 -411
  31. package/lib/cypress.js +0 -98
  32. package/lib/errors.js +0 -392
  33. package/lib/exec/info.js +0 -92
  34. package/lib/exec/open.js +0 -90
  35. package/lib/exec/run.js +0 -176
  36. package/lib/exec/shared.js +0 -62
  37. package/lib/exec/spawn.js +0 -247
  38. package/lib/exec/versions.js +0 -53
  39. package/lib/exec/xvfb.js +0 -93
  40. package/lib/fs.js +0 -4
  41. package/lib/logger.js +0 -50
  42. package/lib/tasks/cache.js +0 -132
  43. package/lib/tasks/download.js +0 -324
  44. package/lib/tasks/get-folder-size.js +0 -33
  45. package/lib/tasks/install.js +0 -368
  46. package/lib/tasks/state.js +0 -185
  47. package/lib/tasks/unzip.js +0 -200
  48. package/lib/tasks/verify.js +0 -300
  49. package/lib/util.js +0 -448
package/lib/cli.js DELETED
@@ -1,411 +0,0 @@
1
- "use strict";
2
-
3
- // @ts-check
4
- const _ = require('lodash');
5
- const commander = require('commander');
6
- const {
7
- stripIndent
8
- } = require('common-tags');
9
- const logSymbols = require('log-symbols');
10
- const debug = require('debug')('cypress:cli:cli');
11
- const util = require('./util');
12
- const logger = require('./logger');
13
- const errors = require('./errors');
14
- const cache = require('./tasks/cache');
15
-
16
- // patch "commander" method called when a user passed an unknown option
17
- // we want to print help for the current command and exit with an error
18
- function unknownOption(flag, type = 'option') {
19
- if (this._allowUnknownOption) return;
20
- logger.error();
21
- logger.error(` error: unknown ${type}:`, flag);
22
- logger.error();
23
- this.outputHelp();
24
- util.exit(1);
25
- }
26
- commander.Command.prototype.unknownOption = unknownOption;
27
- const coerceFalse = arg => {
28
- return arg !== 'false';
29
- };
30
- const coerceAnyStringToInt = arg => {
31
- return typeof arg === 'string' ? parseInt(arg) : arg;
32
- };
33
- const spaceDelimitedArgsMsg = (flag, args) => {
34
- let msg = `
35
- ${logSymbols.warning} Warning: It looks like you're passing --${flag} a space-separated list of arguments:
36
-
37
- "${args.join(' ')}"
38
-
39
- This will work, but it's not recommended.
40
-
41
- If you are trying to pass multiple arguments, separate them with commas instead:
42
- cypress run --${flag} arg1,arg2,arg3
43
- `;
44
- if (flag === 'spec') {
45
- msg += `
46
- The most common cause of this warning is using an unescaped glob pattern. If you are
47
- trying to pass a glob pattern, escape it using quotes:
48
- cypress run --spec "**/*.spec.js"
49
- `;
50
- }
51
- logger.log();
52
- logger.warn(stripIndent(msg));
53
- logger.log();
54
- };
55
- const parseVariableOpts = (fnArgs, args) => {
56
- const [opts, unknownArgs] = fnArgs;
57
- if (unknownArgs && unknownArgs.length && (opts.spec || opts.tag)) {
58
- // this will capture space-delimited args after
59
- // flags that could have possible multiple args
60
- // but before the next option
61
- // --spec spec1 spec2 or --tag foo bar
62
-
63
- const multiArgFlags = _.compact([opts.spec ? 'spec' : opts.spec, opts.tag ? 'tag' : opts.tag]);
64
- _.forEach(multiArgFlags, flag => {
65
- const argIndex = _.indexOf(args, `--${flag}`) + 2;
66
- const nextOptOffset = _.findIndex(_.slice(args, argIndex), arg => {
67
- return _.startsWith(arg, '--');
68
- });
69
- const endIndex = nextOptOffset !== -1 ? argIndex + nextOptOffset : args.length;
70
- const maybeArgs = _.slice(args, argIndex, endIndex);
71
- const extraArgs = _.intersection(maybeArgs, unknownArgs);
72
- if (extraArgs.length) {
73
- opts[flag] = [opts[flag]].concat(extraArgs);
74
- spaceDelimitedArgsMsg(flag, opts[flag]);
75
- opts[flag] = opts[flag].join(',');
76
- }
77
- });
78
- }
79
- debug('variable-length opts parsed %o', {
80
- args,
81
- opts
82
- });
83
- return util.parseOpts(opts);
84
- };
85
- const descriptions = {
86
- autoCancelAfterFailures: 'overrides the project-level Cloud configuration to set the failed test threshold for auto cancellation or to disable auto cancellation when recording to the Cloud',
87
- browser: 'runs Cypress in the browser with the given name. if a filesystem path is supplied, Cypress will attempt to use the browser at that path.',
88
- cacheClear: 'delete all cached binaries',
89
- cachePrune: 'deletes all cached binaries except for the version currently in use',
90
- cacheList: 'list cached binary versions',
91
- cachePath: 'print the path to the binary cache',
92
- cacheSize: 'Used with the list command to show the sizes of the cached folders',
93
- ciBuildId: 'the unique identifier for a run on your CI provider. typically a "BUILD_ID" env var. this value is automatically detected for most CI providers',
94
- component: 'runs component tests',
95
- config: 'sets configuration values. separate multiple values with a comma. overrides any value in cypress.config.{js,ts,mjs,cjs}.',
96
- configFile: 'path to script file where configuration values are set. defaults to "cypress.config.{js,ts,mjs,cjs}".',
97
- detached: 'runs Cypress application in detached mode',
98
- dev: 'runs cypress in development and bypasses binary check',
99
- e2e: 'runs end to end tests',
100
- env: 'sets environment variables. separate multiple values with a comma. overrides any value in cypress.config.{js,ts,mjs,cjs} or cypress.env.json',
101
- exit: 'keep the browser open after tests finish',
102
- forceInstall: 'force install the Cypress binary',
103
- global: 'force Cypress into global mode as if it were globally installed',
104
- group: 'a named group for recorded runs in Cypress Cloud',
105
- headed: 'displays the browser instead of running headlessly',
106
- headless: 'hide the browser instead of running headed (default for cypress run)',
107
- key: 'your secret Record Key. you can omit this if you set a CYPRESS_RECORD_KEY environment variable.',
108
- parallel: 'enables concurrent runs and automatic load balancing of specs across multiple machines or processes',
109
- port: 'runs Cypress on a specific port. overrides any value in cypress.config.{js,ts,mjs,cjs}.',
110
- project: 'path to the project',
111
- quiet: 'run quietly, using only the configured reporter',
112
- record: 'records the run. sends test results, screenshots and videos to Cypress Cloud.',
113
- reporter: 'runs a specific mocha reporter. pass a path to use a custom reporter. defaults to "spec"',
114
- reporterOptions: 'options for the mocha reporter. defaults to "null"',
115
- runnerUi: 'displays the Cypress Runner UI',
116
- noRunnerUi: 'hides the Cypress Runner UI',
117
- spec: 'runs specific spec file(s). defaults to "all"',
118
- tag: 'named tag(s) for recorded runs in Cypress Cloud',
119
- version: 'prints Cypress version'
120
- };
121
- const knownCommands = ['cache', 'help', '-h', '--help', 'install', 'open', 'run', 'verify', '-v', '--version', 'version', 'info'];
122
- const text = description => {
123
- if (!descriptions[description]) {
124
- throw new Error(`Could not find description for: ${description}`);
125
- }
126
- return descriptions[description];
127
- };
128
- function includesVersion(args) {
129
- return _.includes(args, '--version') || _.includes(args, '-v');
130
- }
131
- function showVersions(opts) {
132
- debug('printing Cypress version');
133
- debug('additional arguments %o', opts);
134
- debug('parsed version arguments %o', opts);
135
- const reportAllVersions = versions => {
136
- logger.always('Cypress package version:', versions.package);
137
- logger.always('Cypress binary version:', versions.binary);
138
- logger.always('Electron version:', versions.electronVersion);
139
- logger.always('Bundled Node version:', versions.electronNodeVersion);
140
- };
141
- const reportComponentVersion = (componentName, versions) => {
142
- const names = {
143
- package: 'package',
144
- binary: 'binary',
145
- electron: 'electronVersion',
146
- node: 'electronNodeVersion'
147
- };
148
- if (!names[componentName]) {
149
- throw new Error(`Unknown component name "${componentName}"`);
150
- }
151
- const name = names[componentName];
152
- if (!versions[name]) {
153
- throw new Error(`Cannot find version for component "${componentName}" under property "${name}"`);
154
- }
155
- const version = versions[name];
156
- logger.always(version);
157
- };
158
- const defaultVersions = {
159
- package: undefined,
160
- binary: undefined,
161
- electronVersion: undefined,
162
- electronNodeVersion: undefined
163
- };
164
- return require('./exec/versions').getVersions().then((versions = defaultVersions) => {
165
- if (opts !== null && opts !== void 0 && opts.component) {
166
- reportComponentVersion(opts.component, versions);
167
- } else {
168
- reportAllVersions(versions);
169
- }
170
- process.exit(0);
171
- }).catch(util.logErrorExit1);
172
- }
173
- const createProgram = () => {
174
- const program = new commander.Command();
175
-
176
- // bug in commander not printing name
177
- // in usage help docs
178
- program._name = 'cypress';
179
- program.usage('<command> [options]');
180
- return program;
181
- };
182
- const addCypressRunCommand = program => {
183
- return program.command('run').usage('[options]').description('Runs Cypress tests from the CLI without the GUI').option('--auto-cancel-after-failures <test-failure-count || false>', text('autoCancelAfterFailures')).option('-b, --browser <browser-name-or-path>', text('browser')).option('--ci-build-id <id>', text('ciBuildId')).option('--component', text('component')).option('-c, --config <config>', text('config')).option('-C, --config-file <config-file>', text('configFile')).option('--e2e', text('e2e')).option('-e, --env <env>', text('env')).option('--group <name>', text('group')).option('-k, --key <record-key>', text('key')).option('--headed', text('headed')).option('--headless', text('headless')).option('--no-exit', text('exit')).option('--parallel', text('parallel')).option('-p, --port <port>', text('port')).option('-P, --project <project-path>', text('project')).option('-q, --quiet', text('quiet')).option('--record [bool]', text('record'), coerceFalse).option('-r, --reporter <reporter>', text('reporter')).option('--runner-ui', text('runnerUi')).option('--no-runner-ui', text('noRunnerUi')).option('-o, --reporter-options <reporter-options>', text('reporterOptions')).option('-s, --spec <spec>', text('spec')).option('-t, --tag <tag>', text('tag')).option('--dev', text('dev'), coerceFalse);
184
- };
185
- const addCypressOpenCommand = program => {
186
- return program.command('open').usage('[options]').description('Opens Cypress in the interactive GUI.').option('-b, --browser <browser-path>', text('browser')).option('--component', text('component')).option('-c, --config <config>', text('config')).option('-C, --config-file <config-file>', text('configFile')).option('-d, --detached [bool]', text('detached'), coerceFalse).option('--e2e', text('e2e')).option('-e, --env <env>', text('env')).option('--global', text('global')).option('-p, --port <port>', text('port')).option('-P, --project <project-path>', text('project')).option('--dev', text('dev'), coerceFalse);
187
- };
188
- const maybeAddInspectFlags = program => {
189
- if (process.argv.includes('--dev')) {
190
- return program.option('--inspect', 'Node option').option('--inspect-brk', 'Node option');
191
- }
192
- return program;
193
- };
194
-
195
- /**
196
- * Casts known command line options for "cypress run" to their intended type.
197
- * For example if the user passes "--port 5005" the ".port" property should be
198
- * a number 5005 and not a string "5005".
199
- *
200
- * Returns a clone of the original object.
201
- */
202
- const castCypressOptions = opts => {
203
- // only properties that have type "string | false" in our TS definition
204
- // require special handling, because CLI parsing takes care of purely
205
- // boolean arguments
206
- const castOpts = {
207
- ...opts
208
- };
209
- if (_.has(opts, 'port')) {
210
- castOpts.port = coerceAnyStringToInt(opts.port);
211
- }
212
- return castOpts;
213
- };
214
- module.exports = {
215
- /**
216
- * Parses `cypress run` command line option array into an object
217
- * with options that you can feed into a `cypress.run()` module API call.
218
- * @example
219
- * const options = parseRunCommand(['cypress', 'run', '--browser', 'chrome'])
220
- * // options is {browser: 'chrome'}
221
- */
222
- parseRunCommand(args) {
223
- return new Promise((resolve, reject) => {
224
- if (!Array.isArray(args)) {
225
- return reject(new Error('Expected array of arguments'));
226
- }
227
-
228
- // make a copy of the input arguments array
229
- // and add placeholders where "node ..." would usually be
230
- // also remove "cypress" keyword at the start if present
231
- const cliArgs = args[0] === 'cypress' ? [...args.slice(1)] : [...args];
232
- cliArgs.unshift(null, null);
233
- debug('creating program parser');
234
- const program = createProgram();
235
- maybeAddInspectFlags(addCypressRunCommand(program)).action((...fnArgs) => {
236
- debug('parsed Cypress run %o', fnArgs);
237
- const options = parseVariableOpts(fnArgs, cliArgs);
238
- debug('parsed options %o', options);
239
- const casted = castCypressOptions(options);
240
- debug('casted options %o', casted);
241
- resolve(casted);
242
- });
243
- debug('parsing args: %o', cliArgs);
244
- program.parse(cliArgs);
245
- });
246
- },
247
- /**
248
- * Parses `cypress open` command line option array into an object
249
- * with options that you can feed into cy.openModeSystemTest test calls
250
- * @example
251
- * const options = parseOpenCommand(['cypress', 'open', '--browser', 'chrome'])
252
- * // options is {browser: 'chrome'}
253
- */
254
- parseOpenCommand(args) {
255
- return new Promise((resolve, reject) => {
256
- if (!Array.isArray(args)) {
257
- return reject(new Error('Expected array of arguments'));
258
- }
259
-
260
- // make a copy of the input arguments array
261
- // and add placeholders where "node ..." would usually be
262
- // also remove "cypress" keyword at the start if present
263
- const cliArgs = args[0] === 'cypress' ? [...args.slice(1)] : [...args];
264
- cliArgs.unshift(null, null);
265
- debug('creating program parser');
266
- const program = createProgram();
267
- maybeAddInspectFlags(addCypressOpenCommand(program)).action((...fnArgs) => {
268
- debug('parsed Cypress open %o', fnArgs);
269
- const options = parseVariableOpts(fnArgs, cliArgs);
270
- debug('parsed options %o', options);
271
- const casted = castCypressOptions(options);
272
- debug('casted options %o', casted);
273
- resolve(casted);
274
- });
275
- debug('parsing args: %o', cliArgs);
276
- program.parse(cliArgs);
277
- });
278
- },
279
- /**
280
- * Parses the command line and kicks off Cypress process.
281
- */
282
- init(args) {
283
- if (!args) {
284
- args = process.argv;
285
- }
286
- const {
287
- CYPRESS_INTERNAL_ENV,
288
- CYPRESS_DOWNLOAD_USE_CA
289
- } = process.env;
290
- if (process.env.CYPRESS_DOWNLOAD_USE_CA) {
291
- let msg = `
292
- ${logSymbols.warning} Warning: It looks like you're setting CYPRESS_DOWNLOAD_USE_CA=${CYPRESS_DOWNLOAD_USE_CA}
293
-
294
- The environment variable "CYPRESS_DOWNLOAD_USE_CA" is no longer required to be set.
295
-
296
- You can safely unset this environment variable.
297
- `;
298
- logger.log();
299
- logger.warn(stripIndent(msg));
300
- logger.log();
301
- }
302
- if (!util.isValidCypressInternalEnvValue(CYPRESS_INTERNAL_ENV)) {
303
- debug('invalid CYPRESS_INTERNAL_ENV value', CYPRESS_INTERNAL_ENV);
304
- return errors.exitWithError(errors.errors.invalidCypressEnv)(`CYPRESS_INTERNAL_ENV=${CYPRESS_INTERNAL_ENV}`);
305
- }
306
- if (util.isNonProductionCypressInternalEnvValue(CYPRESS_INTERNAL_ENV)) {
307
- debug('non-production CYPRESS_INTERNAL_ENV value', CYPRESS_INTERNAL_ENV);
308
- let msg = `
309
- ${logSymbols.warning} Warning: It looks like you're passing CYPRESS_INTERNAL_ENV=${CYPRESS_INTERNAL_ENV}
310
-
311
- The environment variable "CYPRESS_INTERNAL_ENV" is reserved and should only be used internally.
312
-
313
- Unset the "CYPRESS_INTERNAL_ENV" environment variable and run Cypress again.
314
- `;
315
- logger.log();
316
- logger.warn(stripIndent(msg));
317
- logger.log();
318
- }
319
- const program = createProgram();
320
- program.command('help').description('Shows CLI help and exits').action(() => {
321
- program.help();
322
- });
323
- const handleVersion = cmd => {
324
- return cmd.option('--component <package|binary|electron|node>', 'component to report version for').action((opts, ...other) => {
325
- showVersions(util.parseOpts(opts));
326
- });
327
- };
328
- handleVersion(program.storeOptionsAsProperties().option('-v, --version', text('version')).command('version').description(text('version')));
329
- maybeAddInspectFlags(addCypressOpenCommand(program)).action(opts => {
330
- debug('opening Cypress');
331
- require('./exec/open').start(util.parseOpts(opts)).then(util.exit).catch(util.logErrorExit1);
332
- });
333
- maybeAddInspectFlags(addCypressRunCommand(program)).action((...fnArgs) => {
334
- debug('running Cypress with args %o', fnArgs);
335
- require('./exec/run').start(parseVariableOpts(fnArgs, args)).then(util.exit).catch(util.logErrorExit1);
336
- });
337
- program.command('install').usage('[options]').description('Installs the Cypress executable matching this package\'s version').option('-f, --force', text('forceInstall')).action(opts => {
338
- require('./tasks/install').start(util.parseOpts(opts)).catch(util.logErrorExit1);
339
- });
340
- program.command('verify').usage('[options]').description('Verifies that Cypress is installed correctly and executable').option('--dev', text('dev'), coerceFalse).action(opts => {
341
- const defaultOpts = {
342
- force: true,
343
- welcomeMessage: false
344
- };
345
- const parsedOpts = util.parseOpts(opts);
346
- const options = _.extend(parsedOpts, defaultOpts);
347
- require('./tasks/verify').start(options).catch(util.logErrorExit1);
348
- });
349
- program.command('cache').usage('[command]').description('Manages the Cypress binary cache').option('list', text('cacheList')).option('path', text('cachePath')).option('clear', text('cacheClear')).option('prune', text('cachePrune')).option('--size', text('cacheSize')).action(function (opts, args) {
350
- if (!args || !args.length) {
351
- this.outputHelp();
352
- util.exit(1);
353
- }
354
- const [command] = args;
355
- if (!_.includes(['list', 'path', 'clear', 'prune'], command)) {
356
- unknownOption.call(this, `cache ${command}`, 'command');
357
- }
358
- if (command === 'list') {
359
- debug('cache command %o', {
360
- command,
361
- size: opts.size
362
- });
363
- return cache.list(opts.size).catch({
364
- code: 'ENOENT'
365
- }, () => {
366
- logger.always('No cached binary versions were found.');
367
- process.exit(0);
368
- }).catch(e => {
369
- debug('cache list command failed with "%s"', e.message);
370
- util.logErrorExit1(e);
371
- });
372
- }
373
- cache[command]();
374
- });
375
- program.command('info').usage('[command]').description('Prints Cypress and system information').option('--dev', text('dev'), coerceFalse).action(opts => {
376
- require('./exec/info').start(opts).then(util.exit).catch(util.logErrorExit1);
377
- });
378
- debug('cli starts with arguments %j', args);
379
- util.printNodeOptions();
380
-
381
- // if there are no arguments
382
- if (args.length <= 2) {
383
- debug('printing help');
384
- program.help();
385
- // exits
386
- }
387
- const firstCommand = args[2];
388
- if (!_.includes(knownCommands, firstCommand)) {
389
- debug('unknown command %s', firstCommand);
390
- logger.error('Unknown command', `"${firstCommand}"`);
391
- program.outputHelp();
392
- return util.exit(1);
393
- }
394
- if (includesVersion(args)) {
395
- // commander 2.11.0 changes behavior
396
- // and now does not understand top level options
397
- // .option('-v, --version').command('version')
398
- // so we have to manually catch '-v, --version'
399
- handleVersion(program);
400
- }
401
- debug('program parsing arguments');
402
- return program.parse(args);
403
- }
404
- };
405
-
406
- // @ts-ignore
407
- if (!module.parent) {
408
- logger.error('This CLI module should be required from another Node module');
409
- logger.error('and not executed directly');
410
- process.exit(-1);
411
- }
package/lib/cypress.js DELETED
@@ -1,98 +0,0 @@
1
- "use strict";
2
-
3
- // https://github.com/cypress-io/cypress/issues/316
4
-
5
- const Promise = require('bluebird');
6
- const tmp = Promise.promisifyAll(require('tmp'));
7
- const fs = require('./fs');
8
- const open = require('./exec/open');
9
- const run = require('./exec/run');
10
- const util = require('./util');
11
- const cli = require('./cli');
12
- const cypressModuleApi = {
13
- /**
14
- * Opens Cypress GUI
15
- * @see https://on.cypress.io/module-api#cypress-open
16
- */
17
- open(options = {}) {
18
- options = util.normalizeModuleOptions(options);
19
- return open.start(options);
20
- },
21
- /**
22
- * Runs Cypress tests in the current project
23
- * @see https://on.cypress.io/module-api#cypress-run
24
- */
25
- run(options = {}) {
26
- if (!run.isValidProject(options.project)) {
27
- return Promise.reject(new Error(`Invalid project path parameter: ${options.project}`));
28
- }
29
- options = util.normalizeModuleOptions(options);
30
- tmp.setGracefulCleanup();
31
- return tmp.fileAsync().then(outputPath => {
32
- options.outputPath = outputPath;
33
- return run.start(options).then(failedTests => {
34
- return fs.readJsonAsync(outputPath, {
35
- throws: false
36
- }).then(output => {
37
- if (!output) {
38
- return {
39
- status: 'failed',
40
- failures: failedTests,
41
- message: 'Could not find Cypress test run results'
42
- };
43
- }
44
- return output;
45
- });
46
- });
47
- });
48
- },
49
- cli: {
50
- /**
51
- * Parses CLI arguments into an object that you can pass to "cypress.run"
52
- * @example
53
- * const cypress = require('cypress')
54
- * const cli = ['cypress', 'run', '--browser', 'firefox']
55
- * const options = await cypress.cli.parseRunArguments(cli)
56
- * // options is {browser: 'firefox'}
57
- * await cypress.run(options)
58
- * @see https://on.cypress.io/module-api
59
- */
60
- parseRunArguments(args) {
61
- return cli.parseRunCommand(args);
62
- }
63
- },
64
- /**
65
- * Provides automatic code completion for configuration in many popular code editors.
66
- * While it's not strictly necessary for Cypress to parse your configuration, we
67
- * recommend wrapping your config object with `defineConfig()`
68
- * @example
69
- * module.exports = defineConfig({
70
- * viewportWith: 400
71
- * })
72
- *
73
- * @see ../types/cypress-npm-api.d.ts
74
- * @param {Cypress.ConfigOptions} config
75
- * @returns {Cypress.ConfigOptions} the configuration passed in parameter
76
- */
77
- defineConfig(config) {
78
- return config;
79
- },
80
- /**
81
- * Provides automatic code completion for Component Frameworks Definitions.
82
- * While it's not strictly necessary for Cypress to parse your configuration, we
83
- * recommend wrapping your Component Framework Definition object with `defineComponentFramework()`
84
- * @example
85
- * module.exports = defineComponentFramework({
86
- * type: 'cypress-ct-solid-js'
87
- * // ...
88
- * })
89
- *
90
- * @see ../types/cypress-npm-api.d.ts
91
- * @param {Cypress.ThirdPartyComponentFrameworkDefinition} config
92
- * @returns {Cypress.ThirdPartyComponentFrameworkDefinition} the configuration passed in parameter
93
- */
94
- defineComponentFramework(config) {
95
- return config;
96
- }
97
- };
98
- module.exports = cypressModuleApi;