@naturalcycles/dev-lib 20.51.0 → 20.51.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.
@@ -47,7 +47,11 @@ const commands = [
47
47
  fn: cleanBuild,
48
48
  desc: 'Cleans ./dist, then runs the build.',
49
49
  },
50
- { name: 'test', fn: runTest, desc: 'Run vitest for *.test.ts files.' },
50
+ {
51
+ name: 'test',
52
+ fn: runTest,
53
+ desc: 'Run vitest for *.test.ts files. Runs once and exits; pass --watch to watch.',
54
+ },
51
55
  {
52
56
  name: 'test-integration',
53
57
  fn: () => runTest({ integration: true }),
@@ -470,6 +470,13 @@ function runVitest(opt) {
470
470
  TEST_TYPE: 'manual',
471
471
  });
472
472
  }
473
+ // Default to "run once and exit" mode, rather than vitest's default of "watch"
474
+ // (which, in an interactive terminal, stays open waiting for input).
475
+ // Pass `--watch` (or `-w`, or the `watch` subcommand) explicitly to opt into watch mode.
476
+ const watch = args.some(a => a === '--watch' || a === '-w' || a === 'watch');
477
+ if (!watch) {
478
+ args.unshift('run');
479
+ }
473
480
  const vitestPath = findPackageBinPath('vitest', 'vitest');
474
481
  exec2.spawn(vitestPath, {
475
482
  args: _uniq(args),
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@naturalcycles/dev-lib",
3
3
  "type": "module",
4
- "version": "20.51.0",
4
+ "version": "20.51.1",
5
5
  "dependencies": {
6
6
  "@naturalcycles/js-lib": "^15",
7
7
  "@naturalcycles/nodejs-lib": "^15",