@joystick.js/cli-canary 0.0.0-canary.123 → 0.0.0-canary.124
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/lib/dev/runTests.js
CHANGED
|
@@ -50,8 +50,7 @@ const handleAvaSTDIO = (ava = {}, options = {}) => {
|
|
|
50
50
|
};
|
|
51
51
|
const runAva = (options = {}) => {
|
|
52
52
|
try {
|
|
53
|
-
const
|
|
54
|
-
const avaPath = `${packageRoot}/node_modules/.bin/ava`;
|
|
53
|
+
const avaPath = `${process.cwd()}/node_modules/.bin/ava`;
|
|
55
54
|
return new Promise((resolve, reject) => {
|
|
56
55
|
const ava = child_process.exec(`${avaPath} --config ${options?.__dirname}/tests.config.js`, {
|
|
57
56
|
stdio: "inherit",
|
package/package.json
CHANGED
package/src/lib/dev/runTests.js
CHANGED
|
@@ -64,13 +64,17 @@ const handleAvaSTDIO = (ava = {}, options = {}) => {
|
|
|
64
64
|
|
|
65
65
|
const runAva = (options = {}) => {
|
|
66
66
|
try {
|
|
67
|
-
// NOTE:
|
|
68
|
-
//
|
|
69
|
-
//
|
|
70
|
-
|
|
71
|
-
|
|
67
|
+
// NOTE: A little bananas to reason through this. In order for Ava to run w/o errors,
|
|
68
|
+
// the Ava binary being run here has to be identical to the one used in @joystick.js/test.
|
|
69
|
+
// That would equal the copy of Ava that's installed in a Joystick app's node_modules
|
|
70
|
+
// directory, not the node_modules directory of the CLI here. We can guarantee that will
|
|
71
|
+
// exist for the CLI here because a developer has to install @joystick.js/test which will
|
|
72
|
+
// add Ava as a dependency to their app in order to write tests.
|
|
73
|
+
const avaPath = `${process.cwd()}/node_modules/.bin/ava`;
|
|
72
74
|
|
|
73
75
|
return new Promise((resolve, reject) => {
|
|
76
|
+
// NOTE: Despite using the app's node_modules path to reference Ava, we still want to reference
|
|
77
|
+
// the internal path here for the default test config in /lib/dev/tests.config.js.
|
|
74
78
|
const ava = child_process.exec(`${avaPath} --config ${options?.__dirname}/tests.config.js`, {
|
|
75
79
|
stdio: 'inherit',
|
|
76
80
|
env: {
|