Right now, I've have had a love hate relationship with JavaScript once I hit the wall of really wanting interfaces. The fact that I can't share an interface really blows. When I was coding in C#, we had used interfaces for our gateways and so my in-memory gateway and real gateways were able to share the C# interface.
Now that I'm doing all node.js, there's no real good way to do this. Since JS is not typed, you have crap like duck typing (what a mess), and really what else?
So for my use cases tests, I'm passing business entity instances from each test into my in-memory gateways. I then inject that gateway into the use case via node module object property.
It'd just be nice if I had an interface to ensure that my real and in-memory are sharing the same interface and adhere to it. Because right now what I'm having to do is copy the method sigs from my in-memory modules to my real gateway just to manually maintain the "contract" that does not really exist in JS.
I am looking for a better way to do this. Thoughts? My collegue is trying to get me to want to code GoLang. It's got interfaces!! I'm so tempted. But yea, not gonna change our code now, it's gonna be node.js.