@joystick.js/cli-canary 0.0.0-canary.127 → 0.0.0-canary.129
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/functions/index.js +2 -8
- package/dist/functions/test/index.js +2 -1
- package/dist/lib/dev/index.js +4 -1
- package/dist/lib/dev/runTests.js +2 -1
- package/package.json +1 -1
- package/src/functions/index.js +2 -8
- package/src/functions/test/index.js +1 -0
- package/src/lib/dev/index.js +5 -2
- package/src/lib/dev/runTests.js +3 -1
package/dist/functions/index.js
CHANGED
|
@@ -221,16 +221,10 @@ var functions_default = {
|
|
|
221
221
|
set: !!rawArgs.includes("test"),
|
|
222
222
|
description: "Start an existing Joystick app and run its tests.",
|
|
223
223
|
args: {
|
|
224
|
-
w: {
|
|
225
|
-
set: !!rawArgs.includes("w") && !!rawArgs[rawArgs.indexOf("w") + 1],
|
|
226
|
-
parent: "w",
|
|
227
|
-
value: !!rawArgs.includes("w") && rawArgs[rawArgs.indexOf("w") + 1],
|
|
228
|
-
description: "Run joystick test in watch mode."
|
|
229
|
-
},
|
|
230
224
|
watch: {
|
|
231
|
-
set: !!rawArgs.includes("watch")
|
|
225
|
+
set: !!rawArgs.includes("watch"),
|
|
232
226
|
parent: "watch",
|
|
233
|
-
value: !!rawArgs.includes("watch")
|
|
227
|
+
value: !!rawArgs.includes("watch"),
|
|
234
228
|
description: "Run joystick test in watch mode."
|
|
235
229
|
}
|
|
236
230
|
},
|
package/dist/lib/dev/index.js
CHANGED
|
@@ -516,6 +516,7 @@ const dev = async (options, { resolve, reject }) => {
|
|
|
516
516
|
process.loader.stop();
|
|
517
517
|
const databaseProcessIds = getDatabaseProcessIds();
|
|
518
518
|
await runTests({
|
|
519
|
+
watch: options?.watch,
|
|
519
520
|
__dirname,
|
|
520
521
|
processIds: [
|
|
521
522
|
...processIds,
|
|
@@ -523,7 +524,9 @@ const dev = async (options, { resolve, reject }) => {
|
|
|
523
524
|
],
|
|
524
525
|
cleanupProcess: process.cleanupProcess
|
|
525
526
|
});
|
|
526
|
-
|
|
527
|
+
if (!options?.watch) {
|
|
528
|
+
process.exit(0);
|
|
529
|
+
}
|
|
527
530
|
}
|
|
528
531
|
resolve();
|
|
529
532
|
} catch (exception) {
|
package/dist/lib/dev/runTests.js
CHANGED
|
@@ -51,8 +51,9 @@ const handleAvaSTDIO = (ava = {}, options = {}) => {
|
|
|
51
51
|
const runAva = (options = {}) => {
|
|
52
52
|
try {
|
|
53
53
|
const avaPath = `${process.cwd()}/node_modules/.bin/ava`;
|
|
54
|
+
conasole.log("OPTIONS IN AVA", options);
|
|
54
55
|
return new Promise((resolve, reject) => {
|
|
55
|
-
const ava = child_process.exec(`${avaPath} --config ${options?.__dirname}/tests.config.js`, {
|
|
56
|
+
const ava = child_process.exec(`${avaPath} --config ${options?.__dirname}/tests.config.js ${options?.watch ? "--watch" : ""}`, {
|
|
56
57
|
stdio: "inherit",
|
|
57
58
|
env: {
|
|
58
59
|
...process.env,
|
package/package.json
CHANGED
package/src/functions/index.js
CHANGED
|
@@ -224,16 +224,10 @@ export default {
|
|
|
224
224
|
set: !!rawArgs.includes('test'),
|
|
225
225
|
description: 'Start an existing Joystick app and run its tests.',
|
|
226
226
|
args: {
|
|
227
|
-
w: {
|
|
228
|
-
set: !!rawArgs.includes('w') && !!rawArgs[rawArgs.indexOf('w') + 1],
|
|
229
|
-
parent: 'w',
|
|
230
|
-
value: !!rawArgs.includes('w') && rawArgs[rawArgs.indexOf('w') + 1],
|
|
231
|
-
description: 'Run joystick test in watch mode.',
|
|
232
|
-
},
|
|
233
227
|
watch: {
|
|
234
|
-
set: !!rawArgs.includes('watch')
|
|
228
|
+
set: !!rawArgs.includes('watch'),
|
|
235
229
|
parent: 'watch',
|
|
236
|
-
value: !!rawArgs.includes('watch')
|
|
230
|
+
value: !!rawArgs.includes('watch'),
|
|
237
231
|
description: 'Run joystick test in watch mode.',
|
|
238
232
|
},
|
|
239
233
|
},
|
package/src/lib/dev/index.js
CHANGED
|
@@ -621,6 +621,7 @@ const dev = async (options, { resolve, reject }) => {
|
|
|
621
621
|
const databaseProcessIds = getDatabaseProcessIds();
|
|
622
622
|
|
|
623
623
|
await runTests({
|
|
624
|
+
watch: options?.watch,
|
|
624
625
|
__dirname,
|
|
625
626
|
processIds: [
|
|
626
627
|
...processIds,
|
|
@@ -629,8 +630,10 @@ const dev = async (options, { resolve, reject }) => {
|
|
|
629
630
|
cleanupProcess: process.cleanupProcess,
|
|
630
631
|
});
|
|
631
632
|
|
|
632
|
-
|
|
633
|
-
|
|
633
|
+
if (!options?.watch) {
|
|
634
|
+
// NOTE: Kick out of the process after tests run if we're not in watch mode.
|
|
635
|
+
process.exit(0);
|
|
636
|
+
}
|
|
634
637
|
}
|
|
635
638
|
|
|
636
639
|
/*
|
package/src/lib/dev/runTests.js
CHANGED
|
@@ -73,10 +73,12 @@ const runAva = (options = {}) => {
|
|
|
73
73
|
// add Ava as a dependency to their app in order to write tests.
|
|
74
74
|
const avaPath = `${process.cwd()}/node_modules/.bin/ava`;
|
|
75
75
|
|
|
76
|
+
conasole.log('OPTIONS IN AVA', options);
|
|
77
|
+
|
|
76
78
|
return new Promise((resolve, reject) => {
|
|
77
79
|
// NOTE: Despite using the app's node_modules path to reference Ava, we still want to reference
|
|
78
80
|
// the internal path here for the default test config in /lib/dev/tests.config.js.
|
|
79
|
-
const ava = child_process.exec(`${avaPath} --config ${options?.__dirname}/tests.config.js`, {
|
|
81
|
+
const ava = child_process.exec(`${avaPath} --config ${options?.__dirname}/tests.config.js ${options?.watch ? '--watch' : ''}`, {
|
|
80
82
|
stdio: 'inherit',
|
|
81
83
|
env: {
|
|
82
84
|
...(process.env),
|