Closed JordanPawlett closed 3 years ago
What do you mean? You can access the transit via broker.transit
.
Sorry for not being more detailed!
I don't think you can import the Transit
class e.g. const { Transit} = require('moleculer')
.
This would be helpful in the instance of writing unit tests for a custom transporter.
transporter = new MyCustomTransporter("custom://custom-server:1234");
transporter.init(new Transit(new ServiceBroker({ logger: false, namespace: "TEST", nodeID: "node-1" })), msgHandler)
Ahh, I see. Ok
The transit object does not seem to be exported from the Moleculer module. Meaning it's very hard to write unit-tests for custom transporters.