@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.
- package/dist/bin/dev-lib.js +5 -1
- package/dist/check.util.js +7 -0
- package/package.json +1 -1
package/dist/bin/dev-lib.js
CHANGED
|
@@ -47,7 +47,11 @@ const commands = [
|
|
|
47
47
|
fn: cleanBuild,
|
|
48
48
|
desc: 'Cleans ./dist, then runs the build.',
|
|
49
49
|
},
|
|
50
|
-
{
|
|
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 }),
|
package/dist/check.util.js
CHANGED
|
@@ -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),
|