@testim/testim-cli 3.287.0 → 3.289.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.
package/cli.js CHANGED
@@ -70,6 +70,11 @@ async function main() {
70
70
  require('./commons/logger').setProjectId(processedOptions.project);
71
71
  require('./commons/runnerFileCache').setEncryptKey(typeof processedOptions.token === 'string' ? processedOptions.token : 'anonymous_encrypt_key');
72
72
 
73
+ if (utils.isInstallLazyDepsMode(processedOptions)) {
74
+ console.log('Lazy dependency installation started');
75
+ const { installAllLazyDependencies } = require('./commons/lazyRequire');
76
+ return await installAllLazyDependencies();
77
+ }
73
78
  if (utils.isInitCodimMode(processedOptions)) {
74
79
  const codimCli = require('./codim/codim-cli');
75
80
  return codimCli.init(processedOptions.initTestProject);
@@ -1,12 +1,13 @@
1
1
  'use strict';
2
2
 
3
- const npmWrapper = require('./npmWrapper');
4
3
  const ora = require('ora');
5
4
  const path = require('path');
6
- const logger = require('./logger').getLogger('lazy-require');
5
+ const npmWrapper = require('./npmWrapper');
6
+ const { getLogger } = require('./logger');
7
7
  const { getCliLocation } = require('../utils');
8
8
  const { requireWithFallback } = require('./requireWithFallback');
9
9
 
10
+ const logger = getLogger('lazy-require');
10
11
  // eslint-disable-next-line import/no-dynamic-require
11
12
  const packageJson = require(path.resolve(getCliLocation(), 'package.json'));
12
13
  const ongoingCalls = new Map();
@@ -75,16 +76,17 @@ async function lazyRequireImpl(dependency) {
75
76
  return requireWithFallback(dependency);
76
77
  }
77
78
 
78
- async function installAllLazyDependencies() {
79
+ module.exports.installAllLazyDependencies = async function installAllLazyDependencies() {
79
80
  const allLazyDependencies = Object.keys(packageJson.lazyDependencies);
80
81
 
81
82
  for (const dep of allLazyDependencies) {
82
83
  await lazyRequireImpl(dep);
83
84
  }
84
- }
85
+ };
85
86
 
87
+ // TODO: remove this once docker-build-tool is not using it
86
88
  if (require.main === module) {
87
- installAllLazyDependencies();
89
+ module.exports.installAllLazyDependencies();
88
90
  }
89
91
 
90
92
  /**
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@testim/testim-cli",
3
- "version": "3.287.0",
3
+ "version": "3.289.0",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@testim/testim-cli",
9
- "version": "3.287.0",
9
+ "version": "3.289.0",
10
10
  "license": "Proprietary",
11
11
  "dependencies": {
12
12
  "@applitools/eyes-sdk-core": "13.11.29",
@@ -4306,9 +4306,9 @@
4306
4306
  }
4307
4307
  },
4308
4308
  "node_modules/define-properties": {
4309
- "version": "1.1.4",
4310
- "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.4.tgz",
4311
- "integrity": "sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA==",
4309
+ "version": "1.2.0",
4310
+ "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.0.tgz",
4311
+ "integrity": "sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA==",
4312
4312
  "dependencies": {
4313
4313
  "has-property-descriptors": "^1.0.0",
4314
4314
  "object-keys": "^1.1.1"
@@ -7096,11 +7096,11 @@
7096
7096
  }
7097
7097
  },
7098
7098
  "node_modules/internal-slot": {
7099
- "version": "1.0.4",
7100
- "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.4.tgz",
7101
- "integrity": "sha512-tA8URYccNzMo94s5MQZgH8NB/XTa6HsOo0MLfXTKKEnHVVdegzaQoFZ7Jp44bdvLvY2waT5dc+j5ICEswhi7UQ==",
7099
+ "version": "1.0.5",
7100
+ "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.5.tgz",
7101
+ "integrity": "sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ==",
7102
7102
  "dependencies": {
7103
- "get-intrinsic": "^1.1.3",
7103
+ "get-intrinsic": "^1.2.0",
7104
7104
  "has": "^1.0.3",
7105
7105
  "side-channel": "^1.0.4"
7106
7106
  },
@@ -8845,9 +8845,9 @@
8845
8845
  }
8846
8846
  },
8847
8847
  "node_modules/minimist": {
8848
- "version": "1.2.7",
8849
- "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.7.tgz",
8850
- "integrity": "sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==",
8848
+ "version": "1.2.8",
8849
+ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",
8850
+ "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==",
8851
8851
  "funding": {
8852
8852
  "url": "https://github.com/sponsors/ljharb"
8853
8853
  }
@@ -19839,9 +19839,9 @@
19839
19839
  "integrity": "sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg=="
19840
19840
  },
19841
19841
  "define-properties": {
19842
- "version": "1.1.4",
19843
- "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.4.tgz",
19844
- "integrity": "sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA==",
19842
+ "version": "1.2.0",
19843
+ "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.0.tgz",
19844
+ "integrity": "sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA==",
19845
19845
  "requires": {
19846
19846
  "has-property-descriptors": "^1.0.0",
19847
19847
  "object-keys": "^1.1.1"
@@ -22085,11 +22085,11 @@
22085
22085
  }
22086
22086
  },
22087
22087
  "internal-slot": {
22088
- "version": "1.0.4",
22089
- "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.4.tgz",
22090
- "integrity": "sha512-tA8URYccNzMo94s5MQZgH8NB/XTa6HsOo0MLfXTKKEnHVVdegzaQoFZ7Jp44bdvLvY2waT5dc+j5ICEswhi7UQ==",
22088
+ "version": "1.0.5",
22089
+ "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.5.tgz",
22090
+ "integrity": "sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ==",
22091
22091
  "requires": {
22092
- "get-intrinsic": "^1.1.3",
22092
+ "get-intrinsic": "^1.2.0",
22093
22093
  "has": "^1.0.3",
22094
22094
  "side-channel": "^1.0.4"
22095
22095
  }
@@ -23459,9 +23459,9 @@
23459
23459
  }
23460
23460
  },
23461
23461
  "minimist": {
23462
- "version": "1.2.7",
23463
- "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.7.tgz",
23464
- "integrity": "sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g=="
23462
+ "version": "1.2.8",
23463
+ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",
23464
+ "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA=="
23465
23465
  },
23466
23466
  "mixin-deep": {
23467
23467
  "version": "1.3.2",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testim/testim-cli",
3
- "version": "3.287.0",
3
+ "version": "3.289.0",
4
4
  "description": "Command line interface for running Testing on your CI",
5
5
  "author": "Oren Rubin",
6
6
  "contributors": [{
@@ -7,3 +7,7 @@ global.XMLHttpRequest = xhr2;
7
7
 
8
8
  // TODO [engine:node@>=16.6.0]: can be removed once we support 16+
9
9
  global.performance = performance;
10
+
11
+ if (typeof Blob === 'undefined') {
12
+ global.Blob = require('buffer').Blob;
13
+ }
package/runOptions.d.ts CHANGED
@@ -1,3 +1,7 @@
1
+ interface InstallLazyDepsOptions {
2
+ installLazyDepsMode: true;
3
+ }
4
+
1
5
  interface LoginModeOptions {
2
6
  loginMode: true;
3
7
  }
@@ -291,6 +295,7 @@ interface RunnerOptions extends Partial<Omit<TunnelOptions, 'tunnelOnlyMode' | '
291
295
  }
292
296
 
293
297
  type Options = |
298
+ InstallLazyDepsOptions |
294
299
  LoginModeOptions |
295
300
  InitModeOptions |
296
301
  AgentModeOptions |
package/runOptions.js CHANGED
@@ -120,6 +120,10 @@ const printUsage = () => {
120
120
  return line.includes('--test-start-timeout');
121
121
  }
122
122
 
123
+ function isInstallLazyDeps(line) {
124
+ return line.includes('--install-lazy-deps');
125
+ }
126
+
123
127
  program.help((txt) => {
124
128
  const lines = txt.split('\n');
125
129
  return lines
@@ -137,7 +141,8 @@ const printUsage = () => {
137
141
  !isExitCodeIgnoreFailingTests(ln) &&
138
142
  !isDeprecatedHighSpeed(ln) &&
139
143
  !isUrls(ln) &&
140
- !isTestStartTimeout(ln),
144
+ !isTestStartTimeout(ln) &&
145
+ !isInstallLazyDeps(ln),
141
146
  )
142
147
  .join('\n');
143
148
  });
@@ -370,6 +375,8 @@ program
370
375
  .option('--intersect-with-label [label]', 'Out of the execution\'s test list, run only those tests that have the specified label', collect, [])
371
376
  .option('--intersect-with-suite [suiteName]', 'Out of the execution\'s test list, run only those tests that are included in the specified suite (by suite name)', collect, [])
372
377
  .option('--intersect-with-suite-id [suiteId]', 'Out of the execution\'s test list, run only those tests that are included in the specified suite (by suite ID)', collect, [])
378
+
379
+ .option('--install-lazy-deps [install-lazy-deps]', 'Install all lazy dependencies from package.json', false)
373
380
  .parse(process.argv);
374
381
 
375
382
 
@@ -439,6 +446,10 @@ module.exports = {
439
446
  process.exit(0);
440
447
  }
441
448
 
449
+ if (program.installLazyDeps) {
450
+ return { installLazyDepsMode: true };
451
+ }
452
+
442
453
  if (program.disableFileCache) {
443
454
  localRunnerCache.disable();
444
455
  }
@@ -13,6 +13,7 @@ const { sessionType, testStatus: testStatusConst } = require('../commons/constan
13
13
  * @typedef {import('../runOptions').NgrokTunnelOptions} NgrokTunnelOptions
14
14
  * @typedef {import('../runOptions').TunnelDaemonOptions} TunnelDaemonOptions
15
15
  * @typedef {import('../runOptions').RunnerOptions} RunnerOptions
16
+ * @typedef {import('../runOptions').InstallLazyDepsOptions} InstallLazyDepsOptions
16
17
  */
17
18
 
18
19
  /** @param {RunnerOptions} options */
@@ -71,6 +72,9 @@ const isTunnelOnlyMode = (options) => Boolean(options.tunnelOnlyMode);
71
72
  /** @type {(options: Options) => options is RunnerOptions & { createPrefechedData: true; }} options */
72
73
  // @ts-ignore should be `as any` etc
73
74
  const isCreatePrefetchedDataMode = (options) => Boolean(options.createPrefechedData);
75
+ /** @type {(options: Options) => options is InstallLazyDepsOptions} options */
76
+ // @ts-ignore should be `as any` etc
77
+ const isInstallLazyDepsMode = (options) => Boolean(options.installLazyDepsMode);
74
78
 
75
79
  module.exports = {
76
80
  getSessionType,
@@ -83,4 +87,5 @@ module.exports = {
83
87
  isLoginMode,
84
88
  isTunnelOnlyMode,
85
89
  isCreatePrefetchedDataMode,
90
+ isInstallLazyDepsMode,
86
91
  };