File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ function findRuntimePath() {
4242 if ( ( upPkg . pkg . dependencies && upPkg . pkg . dependencies [ 'node-red' ] )
4343 || ( upPkg . pkg . devDependencies && upPkg . pkg . devDependencies [ 'node-red' ] ) ) {
4444 const dirpath = path . join ( path . dirname ( upPkg . path ) , 'node_modules' , 'node-red' ) ;
45- try {
45+ try {
4646 const pkg = require ( path . join ( dirpath , 'package.json' ) ) ;
4747 return path . join ( dirpath , pkg . main ) ;
4848 } catch ( ignored ) { }
@@ -52,12 +52,12 @@ function findRuntimePath() {
5252class NodeTestHelper extends EventEmitter {
5353 constructor ( ) {
5454 super ( ) ;
55-
55+
5656 this . _sandbox = sinon . createSandbox ( ) ;
57-
57+
5858 this . _address = '127.0.0.1' ;
5959 this . _listenPort = 0 ; // ephemeral
60-
60+
6161 this . init ( ) ;
6262 }
6363
@@ -97,7 +97,8 @@ class NodeTestHelper extends EventEmitter {
9797 }
9898 }
9999
100- init ( runtimePath = findRuntimePath ( ) ) {
100+ init ( runtimePath ) {
101+ runtimePath = runtimePath || findRuntimePath ( ) ;
101102 if ( runtimePath ) {
102103 this . _initRuntime ( runtimePath ) ;
103104 }
You can’t perform that action at this time.
0 commit comments