@testomatio/reporter 2.8.3 → 2.8.4

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/lib/bin/cli.js CHANGED
@@ -35,10 +35,13 @@ program
35
35
  dotenv_1.default.config();
36
36
  }
37
37
  // --filter-list produces a machine-readable test list on stdout, so route
38
- // logs to stderr and skip the banner to keep stdout clean for piping.
38
+ // remaining output to stderr, skip the banner, and silence info-level
39
+ // logs so the terminal isn't flooded with progress noise.
40
+ // Set TESTOMATIO_LOG_LEVEL=INFO to re-enable progress logs for debugging.
39
41
  const subOpts = actionCommand.opts();
40
42
  if (subOpts.filterList || subOpts.format) {
41
43
  process.env.TESTOMATIO_LOG_STDERR = '1';
44
+ process.env.TESTOMATIO_LOG_LEVEL ||= 'WARN';
42
45
  }
43
46
  else {
44
47
  console.log(picocolors_1.default.cyan(picocolors_1.default.bold(` 🤩 Testomat.io Reporter v${version}`)));
@@ -106,7 +109,11 @@ program
106
109
  try {
107
110
  const tests = await client.prepareRun(prepareRunParams);
108
111
  if (!tests || tests.length === 0) {
109
- log_js_1.log.info(picocolors_1.default.yellow('No tests found.'));
112
+ log_js_1.log.warn(picocolors_1.default.yellow('No tests found.'));
113
+ // Exit non-zero on --filter-list so scripts can detect "nothing to run"
114
+ // via $? and skip launching the runner.
115
+ if (opts.filterList)
116
+ process.exit(1);
110
117
  return;
111
118
  }
112
119
  if (opts.filterList) {
@@ -125,7 +132,9 @@ program
125
132
  }
126
133
  }
127
134
  catch (err) {
128
- log_js_1.log.info(err.message || err);
135
+ log_js_1.log.error(err.message || err);
136
+ if (opts.filterList)
137
+ process.exit(1);
129
138
  return;
130
139
  }
131
140
  }
@@ -125,7 +125,7 @@ class CoveragePipe {
125
125
  log_js_1.log.info(`Matched files: ${[...lines].join(', ')}`);
126
126
  }
127
127
  if (lines.size === 0) {
128
- log_js_1.log.info('â„šī¸ No matching entries in coverage file for provided Git changes.');
128
+ log_js_1.log.warn('â„šī¸ No matching entries in coverage file for provided Git changes.');
129
129
  return [];
130
130
  }
131
131
  // Step 3: Handle tag labels tests from the server
@@ -142,7 +142,7 @@ class CoveragePipe {
142
142
  }
143
143
  }
144
144
  if (this.tests.size === 0 && this.suiteIds.size === 0) {
145
- log_js_1.log.info('â„šī¸ No tests found for execution based on Git changes.');
145
+ log_js_1.log.warn('â„šī¸ No tests found for execution based on Git changes.');
146
146
  return [];
147
147
  }
148
148
  this.results = [...this.tests, ...this.suiteIds];
@@ -201,7 +201,7 @@ class CoveragePipe {
201
201
  ...q,
202
202
  });
203
203
  if (!Array.isArray(resp.data?.tests) && resp.data?.tests?.length === 0) {
204
- log_js_1.log.info(`🔍 No test by ${type}=${id} were found on the Testomat.io server side!`);
204
+ log_js_1.log.warn(`🔍 No test by ${type}=${id} were found on the Testomat.io server side!`);
205
205
  return undefined;
206
206
  }
207
207
  return resp.data.tests;
@@ -276,7 +276,7 @@ class CoveragePipe {
276
276
  log_js_1.log.error(err.message);
277
277
  return undefined;
278
278
  }
279
- log_js_1.log.warn(`We will use '${cmd}' Git command.`);
279
+ log_js_1.log.info(`We will use '${cmd}' Git command.`);
280
280
  try {
281
281
  // For clear unit testing process -> Like test_defaultGitChangedFile = todomvc-tests/edit-todos_test.js
282
282
  if (this.isDefaultGitChanges) {
@@ -285,7 +285,7 @@ class CoveragePipe {
285
285
  else {
286
286
  this.changedFiles = this.#getChangedFilesFromGit(cmd);
287
287
  if (this.changedFiles.length === 0) {
288
- log_js_1.log.info('â„šī¸ No files changed in the latest Git commit. Skipping coverage processing.');
288
+ log_js_1.log.warn('â„šī¸ No files changed in the latest Git commit. Skipping coverage processing.');
289
289
  return undefined;
290
290
  }
291
291
  }
@@ -314,18 +314,18 @@ class CoveragePipe {
314
314
  validateCoverageFile() {
315
315
  // Validate the presence of the coverage filepath
316
316
  if (!fs_1.default.existsSync(this.coverageFilePath)) {
317
- log_js_1.log.info('❌ Coverage file not found:', this.coverageFilePath);
317
+ log_js_1.log.error('❌ Coverage file not found:', this.coverageFilePath);
318
318
  return undefined;
319
319
  }
320
320
  // Ensure the given path is a file (not a directory or other type)
321
321
  const stat = fs_1.default.statSync(this.coverageFilePath);
322
322
  if (!stat.isFile()) {
323
- log_js_1.log.info('❌ Provided coverage path is not a file:', this.coverageFilePath);
323
+ log_js_1.log.error('❌ Provided coverage path is not a file:', this.coverageFilePath);
324
324
  return undefined;
325
325
  }
326
326
  // Validate the file extension to be ".yml" to ensure it's a YAML file
327
327
  if (path_1.default.extname(this.coverageFilePath) !== ".yml") {
328
- log_js_1.log.info('❌ Coverage file must have a .yml extension:', this.coverageFilePath);
328
+ log_js_1.log.error('❌ Coverage file must have a .yml extension:', this.coverageFilePath);
329
329
  return undefined;
330
330
  }
331
331
  debug('Coverage file validation is OK!');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testomatio/reporter",
3
- "version": "2.8.3",
3
+ "version": "2.8.4",
4
4
  "description": "Testomatio Reporter Client",
5
5
  "engines": {
6
6
  "node": ">=18"
package/src/bin/cli.js CHANGED
@@ -33,10 +33,13 @@ program
33
33
  }
34
34
 
35
35
  // --filter-list produces a machine-readable test list on stdout, so route
36
- // logs to stderr and skip the banner to keep stdout clean for piping.
36
+ // remaining output to stderr, skip the banner, and silence info-level
37
+ // logs so the terminal isn't flooded with progress noise.
38
+ // Set TESTOMATIO_LOG_LEVEL=INFO to re-enable progress logs for debugging.
37
39
  const subOpts = actionCommand.opts();
38
40
  if (subOpts.filterList || subOpts.format) {
39
41
  process.env.TESTOMATIO_LOG_STDERR = '1';
42
+ process.env.TESTOMATIO_LOG_LEVEL ||= 'WARN';
40
43
  } else {
41
44
  console.log(pc.cyan(pc.bold(` 🤩 Testomat.io Reporter v${version}`)));
42
45
  }
@@ -116,7 +119,10 @@ program
116
119
  const tests = await client.prepareRun(prepareRunParams);
117
120
 
118
121
  if (!tests || tests.length === 0) {
119
- log.info( pc.yellow('No tests found.'));
122
+ log.warn( pc.yellow('No tests found.'));
123
+ // Exit non-zero on --filter-list so scripts can detect "nothing to run"
124
+ // via $? and skip launching the runner.
125
+ if (opts.filterList) process.exit(1);
120
126
  return;
121
127
  }
122
128
 
@@ -136,7 +142,8 @@ program
136
142
  }
137
143
  }
138
144
  catch (err) {
139
- log.info( err.message || err);
145
+ log.error( err.message || err);
146
+ if (opts.filterList) process.exit(1);
140
147
  return;
141
148
  }
142
149
  }
@@ -140,7 +140,7 @@ class CoveragePipe { // or Changes for the future???
140
140
  }
141
141
 
142
142
  if (lines.size === 0) {
143
- log.info( 'â„šī¸ No matching entries in coverage file for provided Git changes.');
143
+ log.warn( 'â„šī¸ No matching entries in coverage file for provided Git changes.');
144
144
  return [];
145
145
  }
146
146
 
@@ -163,7 +163,7 @@ class CoveragePipe { // or Changes for the future???
163
163
  }
164
164
 
165
165
  if (this.tests.size === 0 && this.suiteIds.size === 0) {
166
- log.info( 'â„šī¸ No tests found for execution based on Git changes.');
166
+ log.warn( 'â„šī¸ No tests found for execution based on Git changes.');
167
167
  return [];
168
168
  }
169
169
 
@@ -234,7 +234,7 @@ class CoveragePipe { // or Changes for the future???
234
234
  });
235
235
 
236
236
  if (!Array.isArray(resp.data?.tests) && resp.data?.tests?.length === 0) {
237
- log.info( `🔍 No test by ${type}=${id} were found on the Testomat.io server side!`);
237
+ log.warn( `🔍 No test by ${type}=${id} were found on the Testomat.io server side!`);
238
238
 
239
239
  return undefined;
240
240
  }
@@ -322,7 +322,7 @@ class CoveragePipe { // or Changes for the future???
322
322
  return undefined;
323
323
  }
324
324
 
325
- log.warn( `We will use '${cmd}' Git command.`);
325
+ log.info( `We will use '${cmd}' Git command.`);
326
326
 
327
327
  try {
328
328
  // For clear unit testing process -> Like test_defaultGitChangedFile = todomvc-tests/edit-todos_test.js
@@ -333,7 +333,7 @@ class CoveragePipe { // or Changes for the future???
333
333
  this.changedFiles = this.#getChangedFilesFromGit(cmd);
334
334
 
335
335
  if (this.changedFiles.length === 0) {
336
- log.info('â„šī¸ No files changed in the latest Git commit. Skipping coverage processing.');
336
+ log.warn('â„šī¸ No files changed in the latest Git commit. Skipping coverage processing.');
337
337
 
338
338
  return undefined;
339
339
  }
@@ -365,20 +365,20 @@ class CoveragePipe { // or Changes for the future???
365
365
  validateCoverageFile() {
366
366
  // Validate the presence of the coverage filepath
367
367
  if (!fs.existsSync(this.coverageFilePath)) {
368
- log.info( '❌ Coverage file not found:', this.coverageFilePath);
368
+ log.error( '❌ Coverage file not found:', this.coverageFilePath);
369
369
  return undefined;
370
370
  }
371
371
 
372
372
  // Ensure the given path is a file (not a directory or other type)
373
373
  const stat = fs.statSync(this.coverageFilePath);
374
374
  if (!stat.isFile()) {
375
- log.info( '❌ Provided coverage path is not a file:', this.coverageFilePath);
375
+ log.error( '❌ Provided coverage path is not a file:', this.coverageFilePath);
376
376
  return undefined;
377
377
  }
378
378
 
379
379
  // Validate the file extension to be ".yml" to ensure it's a YAML file
380
380
  if (path.extname(this.coverageFilePath) !== ".yml") {
381
- log.info( '❌ Coverage file must have a .yml extension:', this.coverageFilePath);
381
+ log.error( '❌ Coverage file must have a .yml extension:', this.coverageFilePath);
382
382
  return undefined;
383
383
  }
384
384