node-red-node-test-helper
node-red-node-test-helper copied to clipboard
unloading throws an error if nothing has been loaded before
If you call unload() but haven't called load(...) before, there will be an unhandled exception caused by this._logSpy.restore() (index.js:257), because this._logSpy is undefined.
This might be a rare use-case but to me unloading should be possible even if there is nothing to unload.
Therefore, I suggest to wrap this line into a if(this._logSpy) { ... } or to add some other form of error handling.
Cheers,
TT