testomatio-reporter-cli 2.10.0 → 2.10.1

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 (2) hide show
  1. package/package.json +1 -1
  2. package/src/bin/cli.js +6 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testomatio-reporter-cli",
3
- "version": "2.10.0",
3
+ "version": "2.10.1",
4
4
  "description": "Yarn Berry compatible standalone CLI for @testomatio/reporter",
5
5
  "type": "module",
6
6
  "bin": {
package/src/bin/cli.js CHANGED
@@ -54,6 +54,7 @@ program
54
54
  .option('--kind <type>', 'Specify run type: automated, manual, or mixed')
55
55
  .option('--filter <filter>', 'Scope the prepared run to tests matching the filter (no execution)')
56
56
  .option('--format <format>', 'Machine-readable output: print only the run id to stdout (e.g. --format id)')
57
+ .option('--warn', 'Exit 0 instead of 1 when the filter matches no tests (warn only)')
57
58
  .action(async opts => {
58
59
  cleanLatestRunId();
59
60
 
@@ -69,7 +70,8 @@ program
69
70
  const tests = await client.prepareRun({ pipe, pipeOptions: optsArray.join(':') });
70
71
  if (!tests || tests.length === 0) {
71
72
  log.warn(pc.yellow('No tests found for the filter. Run not created.'));
72
- process.exit(1);
73
+ // --warn treats an empty match as a normal outcome (e.g. a PR touching no mapped files)
74
+ process.exit(opts.warn ? 0 : 1);
73
75
  }
74
76
  createRunParams.configuration = {
75
77
  tests: tests.filter(id => id.startsWith('T')).map(id => id.slice(1)),
@@ -127,6 +129,7 @@ program
127
129
  (value, prev) => prev.concat([value]),
128
130
  [],
129
131
  )
132
+ .option('--warn', 'Exit 0 instead of 1 when the filter matches no tests (warn only)')
130
133
  .action(async (command, opts) => {
131
134
  if (opts.remote) {
132
135
  if (opts.filterList) {
@@ -162,8 +165,8 @@ program
162
165
  if (!tests || tests.length === 0) {
163
166
  log.warn( pc.yellow('No tests found.'));
164
167
  // Exit non-zero on --filter-list so scripts can detect "nothing to run"
165
- // via $? and skip launching the runner.
166
- if (opts.filterList) process.exit(1);
168
+ // via $? and skip launching the runner. --warn downgrades it to 0.
169
+ if (opts.filterList && !opts.warn) process.exit(1);
167
170
  return;
168
171
  }
169
172