node-red-node-test-helper
node-red-node-test-helper copied to clipboard
Ensure hooks and plugins are included in the mock runtime api
Alternative fix to #73 - rather than stub it, expose the real internal plugin api.
Initial testing suggests more is needed. Parking for now - will merge/release with #73 to unblock some other work that is happening and come back to this another day.
Just tried this locally, and this._RED.plugins is undefined in the index.js
Mentioned that it should have been this._RED.runtime.plugins
Even with this, we then see different behaviour to core:
Test Helper:
RED.plugins.getByType('node-red-dashboard-2') returns Promise { [ ] }
Node-RED Core:
RED.plugins.getByType('node-red-dashboard-2') returns []
@joepavitt that is odd. Can't see anything async in either code path that would result in a promise.