Skip to content

Commit ede9d29

Browse files
committed
fix spawning of yarn process
1 parent a1c9961 commit ede9d29

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

lib/package-manager/test.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,13 @@ function test(packageManager, context, next) {
6565
}
6666
}
6767

68-
/* Run `npm test`, or `/path/to/customTest.js` if the customTest option
68+
/* Run `npm/yarn test`, or `/path/to/customTest.js` if the customTest option
6969
was passed */
70-
const args = context.options.customTest ?
71-
[context.options.customTest] : [packageManagerBin, 'test'];
72-
73-
const proc = spawn(nodeBin, args, options);
70+
const proc = context.options.customTest
71+
? spawn(nodeBin, [context.options.customTest], options)
72+
// We spawn the package manager binary directly instead of via `node` t
73+
// support it being a script instead of a JS file
74+
: spawn(packageManagerBin, ['test'], options);
7475
const finish = timeout(context, proc, next, 'Test');
7576

7677
proc.stdout.on('data', function (data) {

0 commit comments

Comments
 (0)