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,18 +1,20 @@
1
1
  'use strict';
2
2
 
3
+ var _ = require('lodash');
3
4
  var os = require('os');
5
+ var path = require('path');
6
+ var cp = require('child_process');
7
+ var fs$1 = require('fs-extra');
4
8
  var Bluebird = require('bluebird');
5
9
  var Xvfb = require('@cypress/xvfb');
6
10
  var commonTags = require('common-tags');
7
11
  var Debug = require('debug');
8
12
  var chalk = require('chalk');
9
- var _ = require('lodash');
10
13
  var assert = require('assert');
11
14
  var arch = require('arch');
12
15
  var ospath = require('ospath');
13
16
  var hasha = require('hasha');
14
17
  var tty = require('tty');
15
- var path = require('path');
16
18
  var ciInfo = require('ci-info');
17
19
  var execa = require('execa');
18
20
  var si = require('systeminformation');
@@ -22,7 +24,6 @@ var executable = require('executable');
22
24
  var process$1 = require('process');
23
25
  var supportsColor = require('supports-color');
24
26
  var isInstalledGlobally = require('is-installed-globally');
25
- var fs$1 = require('fs-extra');
26
27
  var fs = require('fs');
27
28
  var untildify = require('untildify');
28
29
 
@@ -150,7 +151,9 @@ const getFileSize = (filename) => __awaiter(void 0, void 0, void 0, function* ()
150
151
  const { size } = yield fs$1.stat(filename);
151
152
  return size;
152
153
  });
153
- const isBrokenGtkDisplayRe = /Gtk: cannot open display/;
154
+ // When DISPLAY is set but nothing is listening on it, Electron prints either the Gtk
155
+ // message or the X server one, depending on its version.
156
+ const isBrokenGtkDisplayRe = /Gtk: cannot open display|Missing X server or \$DISPLAY/;
154
157
  const stringify = (val) => {
155
158
  return _.isObject(val) ? JSON.stringify(val) : val;
156
159
  };
@@ -397,6 +400,10 @@ const util = {
397
400
  args = _.compact(args);
398
401
  return chalk.blue(...args);
399
402
  },
403
+ // Download and unzip progress use this to limit how often they update.
404
+ // In an interactive terminal each update redraws the install task list,
405
+ // so updating for every chunk or entry slows the install down.
406
+ progressThrottleMs: 100,
400
407
  calculateEta(percent, elapsed) {
401
408
  // returns the number of seconds remaining
402
409
  // if we're at 100% already just return 0
@@ -510,19 +517,19 @@ const util = {
510
517
  const configVarNameLower = configVarName.toLowerCase();
511
518
  const packageConfigVarName = `npm_package_config_${varName}`;
512
519
  let result;
513
- if (process.env.hasOwnProperty(varName)) {
520
+ if (Object.prototype.hasOwnProperty.call(process.env, varName)) {
514
521
  debug$2(`Using ${varName} from environment variable`);
515
522
  result = process.env[varName];
516
523
  }
517
- else if (process.env.hasOwnProperty(configVarName)) {
524
+ else if (Object.prototype.hasOwnProperty.call(process.env, configVarName)) {
518
525
  debug$2(`Using ${varName} from npm config`);
519
526
  result = process.env[configVarName];
520
527
  }
521
- else if (process.env.hasOwnProperty(configVarNameLower)) {
528
+ else if (Object.prototype.hasOwnProperty.call(process.env, configVarNameLower)) {
522
529
  debug$2(`Using ${varName.toLowerCase()} from npm config`);
523
530
  result = process.env[configVarNameLower];
524
531
  }
525
- else if (process.env.hasOwnProperty(packageConfigVarName)) {
532
+ else if (Object.prototype.hasOwnProperty.call(process.env, packageConfigVarName)) {
526
533
  debug$2(`Using ${varName} from package.json config`);
527
534
  result = process.env[packageConfigVarName];
528
535
  }
@@ -827,7 +834,11 @@ const nonZeroExitCodeXvfb = {
827
834
  const missingXvfb = {
828
835
  description: 'Your system is missing the dependency: Xvfb',
829
836
  solution: commonTags.stripIndent `
830
- Install Xvfb and run Cypress again.
837
+ Install Xvfb and run Cypress again. On Debian and Ubuntu:
838
+
839
+ ${chalk.cyan('apt-get install -y xvfb')}
840
+
841
+ Or run Cypress on a display that already exists by setting the DISPLAY environment variable.
831
842
 
832
843
  Read our documentation on dependencies for more information:
833
844
 
@@ -836,6 +847,22 @@ const missingXvfb = {
836
847
  If you are using Docker, we provide containers with all required dependencies installed.
837
848
  `,
838
849
  };
850
+ const xvfbFailedToStart = (timeoutSeconds) => {
851
+ return {
852
+ description: 'Xvfb is installed but could not start.',
853
+ solution: commonTags.stripIndent `
854
+ Cypress could not start Xvfb, the virtual display it uses on Linux when DISPLAY is not set.
855
+
856
+ Common causes:
857
+
858
+ - The display number is already in use, for example by an Xvfb left running from an earlier run. Stop that Xvfb, or set the XVFB_DISPLAY_NUM environment variable to a free number.
859
+ - Xvfb did not create its display within ${timeoutSeconds} seconds.
860
+ - The Xvfb binary cannot be run by the user running Cypress, or that user cannot write to /tmp.
861
+
862
+ Run Cypress again with DEBUG=cypress:xvfb to see what Xvfb printed.
863
+ `,
864
+ };
865
+ };
839
866
  const smokeTestFailure = (smokeTestCommand, timedOut) => {
840
867
  return {
841
868
  description: `Cypress verification ${timedOut ? 'timed out' : 'failed'}.`,
@@ -868,14 +895,63 @@ const invalidSmokeTestDisplayError = {
868
895
  `;
869
896
  },
870
897
  };
898
+ // Where each library the dynamic linker names comes from on Debian and Ubuntu
899
+ const APT_PACKAGES = {
900
+ 'libnss3.so': 'libnss3',
901
+ 'libgtk-3.so.0': 'libgtk-3-0',
902
+ 'libgbm.so.1': 'libgbm1',
903
+ // The package was renamed in Debian 13 and Ubuntu 24.04, so the line falls back to the old name
904
+ 'libasound.so.2': 'libasound2t64 || apt-get install -y libasound2',
905
+ 'libXss.so.1': 'libxss1',
906
+ 'libXtst.so.6': 'libxtst6',
907
+ 'libX11-xcb.so.1': 'libx11-xcb1',
908
+ 'libxkbcommon.so.0': 'libxkbcommon0',
909
+ 'libatk-1.0.so.0': 'libatk1.0-0',
910
+ 'libatk-bridge-2.0.so.0': 'libatk-bridge2.0-0',
911
+ 'libcups.so.2': 'libcups2',
912
+ 'libdrm.so.2': 'libdrm2',
913
+ 'libnspr4.so': 'libnspr4',
914
+ 'libXcomposite.so.1': 'libxcomposite1',
915
+ 'libXdamage.so.1': 'libxdamage1',
916
+ 'libXrandr.so.2': 'libxrandr2',
917
+ 'libcairo.so.2': 'libcairo2',
918
+ 'libpango-1.0.so.0': 'libpango-1.0-0',
919
+ };
920
+ const parseMissingLibraries = (output = '') => {
921
+ const libraries = Array.from(output.matchAll(/error while loading shared libraries: ([^:\s]+):/g), (match) => match[1]);
922
+ return _.uniq(libraries);
923
+ };
924
+ const missingLibrariesSolution = (libraries) => {
925
+ const known = libraries.filter((library) => APT_PACKAGES[library]);
926
+ const unknown = libraries.filter((library) => !APT_PACKAGES[library]);
927
+ const lines = [
928
+ `Cypress could not start because the system ${libraries.length === 1 ? 'library' : 'libraries'} below could not be loaded:`,
929
+ '',
930
+ ...libraries.map((library) => ` ${library}`),
931
+ ];
932
+ if (known.length) {
933
+ lines.push('', 'On Debian and Ubuntu, install the packages that provide them:', '', ...known.map((library) => ` apt-get install -y ${APT_PACKAGES[library]}`));
934
+ }
935
+ if (unknown.length) {
936
+ lines.push('', 'Find the package that provides each of these with apt-file, or your distribution\'s equivalent:', '', ...unknown.map((library) => ` apt-file search ${library}`));
937
+ }
938
+ lines.push('', `More about the required dependencies: ${chalk.blue(requiredDependenciesUrl)}`);
939
+ return lines.join('\n');
940
+ };
871
941
  const missingDependency = {
872
942
  description: 'Cypress failed to start.',
873
- // this message is too Linux specific
874
- solution: commonTags.stripIndent `
875
- This may be due to a missing library or dependency. ${chalk.blue(requiredDependenciesUrl)}
876
-
877
- Please refer to the error below for more details.
878
- `,
943
+ // A function is given the error output, and when it is, it is responsible for printing it
944
+ solution: (msg) => {
945
+ const libraries = parseMissingLibraries(msg);
946
+ // this message is too Linux specific
947
+ const advice = libraries.length ? missingLibrariesSolution(libraries) : commonTags.stripIndent `
948
+ This may be due to a missing library or dependency. ${chalk.blue(requiredDependenciesUrl)}
949
+ `;
950
+ if (!msg) {
951
+ return advice;
952
+ }
953
+ return [advice, '', 'Please refer to the error below for more details.', '', hr, '', msg].join('\n');
954
+ },
879
955
  };
880
956
  const invalidCacheDirectory = {
881
957
  description: 'Cypress cannot write to the cache directory due to file permissions',
@@ -1026,6 +1102,7 @@ const errors = {
1026
1102
  unknownError,
1027
1103
  nonZeroExitCodeXvfb,
1028
1104
  missingXvfb,
1105
+ xvfbFailedToStart,
1029
1106
  missingApp,
1030
1107
  notInstalledCI,
1031
1108
  missingDependency,
@@ -1052,9 +1129,10 @@ const errors = {
1052
1129
  const debug = Debug('cypress:cli');
1053
1130
  const debugXvfb = Debug('cypress:xvfb');
1054
1131
  debug.Debug = debugXvfb.Debug = Debug;
1132
+ const XVFB_START_TIMEOUT_SECONDS = 30;
1055
1133
  const xvfbOptions = {
1056
1134
  displayNum: process.env.XVFB_DISPLAY_NUM,
1057
- timeout: 30000, // milliseconds
1135
+ timeout: XVFB_START_TIMEOUT_SECONDS * 1000,
1058
1136
  // need to explicitly define screen otherwise electron will crash
1059
1137
  // https://github.com/cypress-io/cypress/issues/6184
1060
1138
  xvfb_args: ['-screen', '0', '1280x1024x24'],
@@ -1064,15 +1142,140 @@ const xvfbOptions = {
1064
1142
  }
1065
1143
  },
1066
1144
  };
1145
+ // Starts Xvfb in a session of its own with no pipes to the CLI, so an app that keeps running
1146
+ // after the CLI exits keeps its display when a host ends the CLI's process group or closes its
1147
+ // output. @cypress/xvfb offers no option for this, so only the spawn is replaced and the lock file
1148
+ // wait and timeout stay the library's.
1149
+ // Once the CLI has exited nothing is left to stop this Xvfb, so `-terminate` has it exit, and remove
1150
+ // its lock file, when its last client disconnects: when the app closes or crashes.
1151
+ // The library ships no usable types for the members the override reaches into
1152
+ const XvfbBase = Xvfb;
1153
+ // A file rather than a pipe: once the CLI exits, Xvfb's next write to a pipe would end it
1154
+ function openStderrFile() {
1155
+ return __awaiter(this, void 0, void 0, function* () {
1156
+ const dir = yield fs$1.mkdtemp(path.join(os.tmpdir(), 'cypress-xvfb-'));
1157
+ const file = path.join(dir, 'stderr');
1158
+ try {
1159
+ return { dir, file, fd: yield fs$1.open(file, 'wx', 0o600) };
1160
+ }
1161
+ catch (err) {
1162
+ yield fs$1.remove(dir).catch(() => undefined);
1163
+ throw err;
1164
+ }
1165
+ });
1166
+ }
1167
+ class DetachedXvfb extends XvfbBase {
1168
+ // Without it the class takes no arguments as far as the type checker can tell
1169
+ constructor(options) {
1170
+ var _a;
1171
+ super(options);
1172
+ this._avoidDisplays = (_a = options.avoidDisplays) !== null && _a !== void 0 ? _a : [];
1173
+ }
1174
+ // Picks the first free display as the library does, but skips `avoidDisplays`, so a Xvfb left
1175
+ // running for the app does not hold a display that a later run in this process will use
1176
+ display() {
1177
+ if (!this._display) {
1178
+ let displayNum = 99;
1179
+ while (this._avoidDisplays.includes(displayNum) || fs$1.existsSync(this._lockFile(displayNum))) {
1180
+ displayNum++;
1181
+ }
1182
+ this._display = `:${displayNum}`;
1183
+ }
1184
+ return this._display;
1185
+ }
1186
+ // What Xvfb prints is only read when it fails to start, so it reaches DEBUG=cypress:xvfb and
1187
+ // the error as it does for an Xvfb started with pipes. Without a file for it, Xvfb still starts.
1188
+ start(cb) {
1189
+ openStderrFile().catch((err) => {
1190
+ debug('no file for the output of Xvfb, discarding it', err);
1191
+ }).then((stderrFile) => {
1192
+ this._stderrFile = stderrFile !== null && stderrFile !== void 0 ? stderrFile : undefined;
1193
+ super.start((err, proc) => __awaiter(this, void 0, void 0, function* () {
1194
+ yield this._drainStderr(err);
1195
+ cb === null || cb === void 0 ? void 0 : cb(err, proc);
1196
+ }));
1197
+ });
1198
+ }
1199
+ // Removing the file once Xvfb has started leaves it writing to a file nobody can open, so
1200
+ // nothing is left in the temp directory for an Xvfb that outlives the CLI
1201
+ _drainStderr(err) {
1202
+ return __awaiter(this, void 0, void 0, function* () {
1203
+ const stderrFile = this._stderrFile;
1204
+ if (!stderrFile) {
1205
+ return;
1206
+ }
1207
+ this._stderrFile = undefined;
1208
+ try {
1209
+ yield fs$1.close(stderrFile.fd);
1210
+ if (!err) {
1211
+ return;
1212
+ }
1213
+ const output = (yield fs$1.readFile(stderrFile.file, 'utf8')).trim();
1214
+ if (output) {
1215
+ this._onStderrData(output);
1216
+ if (err.nonZeroExitCode) {
1217
+ err.message = `${err.message}:\n${output}`;
1218
+ }
1219
+ }
1220
+ }
1221
+ catch (_a) {
1222
+ // Best effort: the start error is reported either way
1223
+ }
1224
+ finally {
1225
+ yield fs$1.remove(stderrFile.dir).catch(() => undefined);
1226
+ }
1227
+ });
1228
+ }
1229
+ _spawnProcess(lockFileExists, onAsyncSpawnError) {
1230
+ var _a, _b;
1231
+ // A process that cannot be spawned emits both 'error' and 'exit', and start reports only one
1232
+ const onError = _.once(onAsyncSpawnError);
1233
+ const display = this.display();
1234
+ if (lockFileExists) {
1235
+ if (!this._reuse) {
1236
+ throw new Error(`Display ${display} is already in use and the "reuse" option is false.`);
1237
+ }
1238
+ return;
1239
+ }
1240
+ const stderr = (_b = (_a = this._stderrFile) === null || _a === void 0 ? void 0 : _a.fd) !== null && _b !== void 0 ? _b : 'ignore';
1241
+ const proc = cp.spawn('Xvfb', [display, '-terminate', ...this._xvfb_args], { detached: true, stdio: ['ignore', 'ignore', stderr] });
1242
+ this._process = proc;
1243
+ proc.once('error', onError);
1244
+ proc.once('exit', (code, signal) => {
1245
+ if (code !== 0) {
1246
+ const err = new Error(code === null ? `Xvfb was killed by ${signal}` : `Xvfb exited with code ${code}`);
1247
+ err.nonZeroExitCode = true;
1248
+ onError(err);
1249
+ }
1250
+ });
1251
+ proc.unref();
1252
+ }
1253
+ }
1067
1254
  const xvfb = Bluebird.promisifyAll(new Xvfb(xvfbOptions));
1255
+ // The instance that was started, so `stop` ends that one. Each detached launch gets its own, since
1256
+ // the Xvfb a previous one left for its app may still hold its display.
1257
+ let running = xvfb;
1068
1258
  const _debugXvfb = debugXvfb;
1069
1259
  const _xvfb = xvfb;
1070
1260
  const _xvfbOptions = xvfbOptions;
1261
+ // The Xvfb started for a detached app keeps its display for as long as the app runs, so it leaves
1262
+ // XVFB_DISPLAY_NUM, and the display the Xvfb that stops with the CLI has already picked, to that one
1263
+ function createDetachedXvfb() {
1264
+ var _a;
1265
+ if (xvfbOptions.displayNum) {
1266
+ loggerModule.warn('XVFB_DISPLAY_NUM is set and was ignored because a detached Cypress app keeps its display running after Cypress returns.');
1267
+ }
1268
+ const avoidDisplays = [xvfbOptions.displayNum, (_a = xvfb._display) === null || _a === void 0 ? void 0 : _a.slice(1)]
1269
+ .filter(Boolean)
1270
+ .map(Number);
1271
+ return new DetachedXvfb(Object.assign(Object.assign({}, _.omit(xvfbOptions, 'displayNum')), { avoidDisplays }));
1272
+ }
1071
1273
  function start() {
1072
- return __awaiter(this, void 0, void 0, function* () {
1073
- debug('Starting Xvfb');
1274
+ return __awaiter(this, arguments, void 0, function* ({ detached = false } = {}) {
1275
+ debug('Starting Xvfb', { detached });
1276
+ running = detached ? Bluebird.promisifyAll(createDetachedXvfb()) : xvfb;
1074
1277
  try {
1075
- yield xvfb.startAsync();
1278
+ yield running.startAsync();
1076
1279
  return null;
1077
1280
  }
1078
1281
  catch (e) {
@@ -1083,7 +1286,8 @@ function start() {
1083
1286
  if (e.known) {
1084
1287
  throw e;
1085
1288
  }
1086
- const raiseErrorFn = throwFormErrorText(errors.missingXvfb);
1289
+ // Only a binary that is not there is a missing dependency
1290
+ const raiseErrorFn = throwFormErrorText(e.code === 'ENOENT' ? errors.missingXvfb : errors.xvfbFailedToStart(XVFB_START_TIMEOUT_SECONDS));
1087
1291
  yield raiseErrorFn(e);
1088
1292
  }
1089
1293
  });
@@ -1092,7 +1296,7 @@ function stop() {
1092
1296
  return __awaiter(this, void 0, void 0, function* () {
1093
1297
  debug('Stopping Xvfb');
1094
1298
  try {
1095
- yield xvfb.stopAsync();
1299
+ yield running.stopAsync();
1096
1300
  return null;
1097
1301
  }
1098
1302
  catch (e) {
@@ -1100,18 +1304,24 @@ function stop() {
1100
1304
  }
1101
1305
  });
1102
1306
  }
1103
- function isNeeded() {
1104
- if (process.env.ELECTRON_RUN_AS_NODE) {
1307
+ // Leaves a detached Xvfb running for the app it was started for. The CLI gets its own DISPLAY back
1308
+ // and forgets that Xvfb, so a later launch from the same process neither uses nor stops it.
1309
+ function release() {
1310
+ running._restoreDisplayEnvVariable();
1311
+ running = xvfb;
1312
+ }
1313
+ function isNeeded(env = process.env) {
1314
+ if (env.ELECTRON_RUN_AS_NODE) {
1105
1315
  debug('Environment variable ELECTRON_RUN_AS_NODE detected, xvfb is not needed');
1106
1316
  return false; // xvfb required for electron processes only.
1107
1317
  }
1108
1318
  if (os.platform() !== 'linux') {
1109
1319
  return false;
1110
1320
  }
1111
- if (process.env.DISPLAY) {
1321
+ if (env.DISPLAY) {
1112
1322
  const issueUrl = util.getGitHubIssueUrl(4034);
1113
1323
  const message = commonTags.stripIndent `
1114
- DISPLAY environment variable is set to ${process.env.DISPLAY} on Linux
1324
+ DISPLAY environment variable is set to ${env.DISPLAY} on Linux
1115
1325
  Assuming this DISPLAY points at working X11 server,
1116
1326
  Cypress will not spawn own Xvfb
1117
1327
 
@@ -1149,11 +1359,13 @@ var xvfb$1 = {
1149
1359
  _xvfbOptions,
1150
1360
  start,
1151
1361
  stop,
1362
+ release,
1152
1363
  isNeeded,
1153
1364
  verify,
1154
1365
  };
1155
1366
 
1156
1367
  exports.DEVELOPMENT_VERSION = DEVELOPMENT_VERSION;
1368
+ exports.DetachedXvfb = DetachedXvfb;
1157
1369
  exports.__awaiter = __awaiter;
1158
1370
  exports._debugXvfb = _debugXvfb;
1159
1371
  exports._xvfb = _xvfb;
@@ -1165,6 +1377,7 @@ exports.isNeeded = isNeeded;
1165
1377
  exports.loggerModule = loggerModule;
1166
1378
  exports.posixify = posixify;
1167
1379
  exports.relativeToRepoRoot = relativeToRepoRoot;
1380
+ exports.release = release;
1168
1381
  exports.start = start;
1169
1382
  exports.stateModule = stateModule;
1170
1383
  exports.stop = stop;
@@ -15,6 +15,7 @@ export const getContainerEl = () => {
15
15
  * Utility function to register CT side effects and run cleanup code during the "test:before:run" Cypress hook
16
16
  * @param optionalCallback Callback to be called before the next test runs
17
17
  */
18
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type -- published API; narrowing the parameter would break callers that pass a `Function`
18
19
  export function setupHooks(optionalCallback) {
19
20
  // We don't want CT side effects to run when e2e
20
21
  // testing so we early return.
@@ -30,6 +30,7 @@
30
30
  "@rollup/plugin-commonjs": "^29.0.2",
31
31
  "@rollup/plugin-node-resolve": "^16.0.3",
32
32
  "eslint": "^9.31.0",
33
+ "jiti": "^2.4.2",
33
34
  "lodash": "^4.17.21",
34
35
  "rollup": "4.60.2",
35
36
  "rollup-plugin-dts": "6.4.1",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cypress",
3
- "version": "16.2.1",
3
+ "version": "16.3.0",
4
4
  "main": "dist/index.js",
5
5
  "scripts": {
6
6
  "postinstall": "node dist/index.js --exec install",
@@ -41,7 +41,7 @@
41
41
  "proxy-from-env": "1.0.0",
42
42
  "request-progress": "^3.0.0",
43
43
  "supports-color": "^8.1.1",
44
- "systeminformation": "^5.31.1",
44
+ "systeminformation": "^5.33.16",
45
45
  "tmp": "~0.2.4",
46
46
  "tree-kill": "1.2.2",
47
47
  "untildify": "^4.0.0",
@@ -132,8 +132,8 @@
132
132
  },
133
133
  "buildInfo": {
134
134
  "commitBranch": "develop",
135
- "commitSha": "519d66d80b0ae1bd3f9581665ce69473b82af59b",
136
- "commitDate": "2026-10-27T21:23:59.000Z",
135
+ "commitSha": "e5b073de605c59a31cf6d9a6fb6576b82a0bfb7d",
136
+ "commitDate": "2026-11-10T17:04:56.000Z",
137
137
  "stable": true
138
138
  },
139
139
  "description": "Cypress is a next generation front end testing tool built for the modern web",
@@ -83,6 +83,7 @@ const getContainerEl = () => {
83
83
  * Utility function to register CT side effects and run cleanup code during the "test:before:run" Cypress hook
84
84
  * @param optionalCallback Callback to be called before the next test runs
85
85
  */
86
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type -- published API; narrowing the parameter would break callers that pass a `Function`
86
87
  function setupHooks(optionalCallback) {
87
88
  // We don't want CT side effects to run when e2e
88
89
  // testing so we early return.
@@ -143,7 +144,9 @@ const makeMountFn = (type, jsx, options = {}, rerenderKey, internalMountOptions)
143
144
  // let's get back the original component
144
145
  const userComponent = reactComponent.props.children;
145
146
  internalMountOptions.render(reactComponent, el, reactDomToUse);
146
- return (cy.wrap(userComponent, { log: false })
147
+ return (
148
+ // eslint-disable-next-line cypress/no-unnecessary-waiting -- the chained zero-length wait is the event-loop tick described below
149
+ cy.wrap(userComponent, { log: false })
147
150
  .then(() => {
148
151
  return cy.wrap({
149
152
  component: userComponent,
@@ -62,6 +62,7 @@ const getContainerEl = () => {
62
62
  * Utility function to register CT side effects and run cleanup code during the "test:before:run" Cypress hook
63
63
  * @param optionalCallback Callback to be called before the next test runs
64
64
  */
65
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type -- published API; narrowing the parameter would break callers that pass a `Function`
65
66
  function setupHooks(optionalCallback) {
66
67
  // We don't want CT side effects to run when e2e
67
68
  // testing so we early return.
@@ -122,7 +123,9 @@ const makeMountFn = (type, jsx, options = {}, rerenderKey, internalMountOptions)
122
123
  // let's get back the original component
123
124
  const userComponent = reactComponent.props.children;
124
125
  internalMountOptions.render(reactComponent, el, reactDomToUse);
125
- return (cy.wrap(userComponent, { log: false })
126
+ return (
127
+ // eslint-disable-next-line cypress/no-unnecessary-waiting -- the chained zero-length wait is the event-loop tick described below
128
+ cy.wrap(userComponent, { log: false })
126
129
  .then(() => {
127
130
  return cy.wrap({
128
131
  component: userComponent,
@@ -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.
@@ -60,7 +61,7 @@ const cleanup = () => {
60
61
  // Extract the component name from the object passed to mount
61
62
  const getComponentDisplayName = (Component) => {
62
63
  if (Component.name) {
63
- const [, match] = /Proxy\<(\w+)\>/.exec(Component.name) || [];
64
+ const [, match] = /Proxy<(\w+)>/.exec(Component.name) || [];
64
65
  return match || Component.name;
65
66
  }
66
67
  return DEFAULT_COMP_NAME;
@@ -96,6 +97,7 @@ function mount(Component, options = {}) {
96
97
  componentInstance = svelte.mount(ComponentConstructor, Object.assign({ target }, options));
97
98
  // by waiting, we are delaying test execution for the next tick of event loop
98
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
99
101
  return cy.wait(0, { log: false }).then(() => {
100
102
  if (options.log !== false) {
101
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.
@@ -58,7 +59,7 @@ const cleanup = () => {
58
59
  // Extract the component name from the object passed to mount
59
60
  const getComponentDisplayName = (Component) => {
60
61
  if (Component.name) {
61
- const [, match] = /Proxy\<(\w+)\>/.exec(Component.name) || [];
62
+ const [, match] = /Proxy<(\w+)>/.exec(Component.name) || [];
62
63
  return match || Component.name;
63
64
  }
64
65
  return DEFAULT_COMP_NAME;
@@ -94,6 +95,7 @@ function mount(Component, options = {}) {
94
95
  componentInstance = mount$1(ComponentConstructor, Object.assign({ target }, options));
95
96
  // by waiting, we are delaying test execution for the next tick of event loop
96
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
97
99
  return cy.wait(0, { log: false }).then(() => {
98
100
  if (options.log !== false) {
99
101
  const mountMessage = `<${getComponentDisplayName(Component)} ... />`;
@@ -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
  }
@@ -226,6 +226,7 @@ declare namespace Cypress {
226
226
  [key: string]: Storable
227
227
  }
228
228
 
229
+ // eslint-disable-next-line @typescript-eslint/no-empty-object-type -- public type; kept an interface because a type alias would stop declaration merging in user code
229
230
  interface StorableArray extends Array<Storable> { }
230
231
 
231
232
  type StorableRecord = Record<string, Storable>
@@ -326,6 +327,7 @@ declare namespace Cypress {
326
327
  /**
327
328
  * The interface for user-defined properties in Window object under test.
328
329
  */
330
+ // eslint-disable-next-line @typescript-eslint/no-empty-object-type -- users declare their AUT window properties by merging into it
329
331
  interface ApplicationWindow { } // tslint:disable-line
330
332
 
331
333
  /**
@@ -4190,7 +4192,7 @@ declare namespace Cypress {
4190
4192
  ensureScrollable: boolean
4191
4193
  }
4192
4194
 
4193
- interface ScrollIntoViewOptions extends ScrollToOptions {
4195
+ interface ScrollIntoViewOptions extends Omit<ScrollToOptions, 'ensureScrollable'> {
4194
4196
  /**
4195
4197
  * Amount to scroll after the element has been scrolled into view
4196
4198
  *
@@ -5076,8 +5078,10 @@ declare namespace Cypress {
5076
5078
  * @see http://chaijs.com/api/bdd/#method_throw
5077
5079
  * @see https://on.cypress.io/assertions
5078
5080
  */
5081
+ /* eslint-disable @typescript-eslint/no-unsafe-function-type -- public type; `Function` here is any error constructor, and narrowing it would break users */
5079
5082
  // tslint:disable-next-line ban-types
5080
5083
  (chainer: 'throw', error: Error | Function, expected?: string | RegExp): Chainable<Subject>
5084
+ /* eslint-enable @typescript-eslint/no-unsafe-function-type */
5081
5085
  /**
5082
5086
  * Asserts that the target is a member of the given array list.
5083
5087
  * @example
@@ -5680,8 +5684,10 @@ declare namespace Cypress {
5680
5684
  * @see http://chaijs.com/api/bdd/#method_throw
5681
5685
  * @see https://on.cypress.io/assertions
5682
5686
  */
5687
+ /* eslint-disable @typescript-eslint/no-unsafe-function-type -- public type; `Function` here is any error constructor, and narrowing it would break users */
5683
5688
  // tslint:disable-next-line ban-types
5684
5689
  (chainer: 'not.throw', error: Error | Function, expected?: string | RegExp): Chainable<Subject>
5690
+ /* eslint-enable @typescript-eslint/no-unsafe-function-type */
5685
5691
  /**
5686
5692
  * Asserts that the target is a member of the given array list.
5687
5693
  * @example
@@ -7066,6 +7072,7 @@ declare namespace Cypress {
7066
7072
  }
7067
7073
  ```
7068
7074
  */
7075
+ // eslint-disable-next-line @typescript-eslint/no-empty-object-type -- users add custom properties by merging into it, as documented above
7069
7076
  interface cy extends Chainable<undefined> { }
7070
7077
  }
7071
7078
 
@@ -74,7 +74,7 @@ type Method =
74
74
 
75
75
  export type ResourceType = 'document' | 'fetch' | 'xhr' | 'websocket' | 'stylesheet' | 'script' | 'image' | 'font' | 'cspviolationreport' | 'ping' | 'manifest' | 'other'
76
76
 
77
- export namespace CyHttpMessages {
77
+ export declare namespace CyHttpMessages {
78
78
  export interface BaseMessage<T = any> {
79
79
  /**
80
80
  * The body of the HTTP message.
@@ -81,6 +81,7 @@ const getContainerEl = () => {
81
81
  * Utility function to register CT side effects and run cleanup code during the "test:before:run" Cypress hook
82
82
  * @param optionalCallback Callback to be called before the next test runs
83
83
  */
84
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type -- published API; narrowing the parameter would break callers that pass a `Function`
84
85
  function setupHooks(optionalCallback) {
85
86
  // We don't want CT side effects to run when e2e
86
87
  // testing so we early return.
@@ -8600,6 +8601,7 @@ const cleanup = () => {
8600
8601
  Cypress.vueWrapper = null;
8601
8602
  Cypress.vue = null;
8602
8603
  };
8604
+ /* eslint-enable @typescript-eslint/no-empty-object-type */
8603
8605
  /**
8604
8606
  * Mounts a component and returns an object containing the component and VueWrapper
8605
8607
  * @param componentOptions
@@ -8638,6 +8640,7 @@ function mount(componentOptions, options = {}) {
8638
8640
  const wrapper = VTUmount(componentOptions, Object.assign({ attachTo: componentNode }, options));
8639
8641
  Cypress.vueWrapper = wrapper;
8640
8642
  Cypress.vue = wrapper.vm;
8643
+ // eslint-disable-next-line cypress/no-unnecessary-waiting -- yields so the component's lifecycle hooks run before the test continues
8641
8644
  return cy
8642
8645
  .wait(1, { log: false })
8643
8646
  .then(() => {