Unit testing the JS + OverwolfPlugin integration


My app basically consists of two main parts: a C# plugin that parses the game’s log file and emits events, and the JS part that listen to these events and publish something.

I’m looking at building integration tests that check, for a given log file, if the published output from my app is correct.

To do so, I would need to load the dll plugin from my unit tests (running with Jest).
Today, it fails because the overwolfplugin.js relies on overwolf.extensions.current.getExtraObject.
Do you know of a way to handle this in unit tests? Has anyone done it yet?


hi @sebastientromp.

We are checking this issue and will update soon.


Since you can work with JS-based (node.js) frameworks like Jest or Mocha - you can basically create a mock object of both the DLL interface and the getExtraObject function - and then write a log parser in node.js.

That would be the way I’d go with this.

This is what I’ve started to do(I’m moving the whole service that interfaces with the dll). I still would like to run a full integration/end to end test though.
From what you’re saying, I understand that this is not possible today?

Again, if you are running this in node.js - you could find/create a native node.js extension that allows you to load and call your c# library.

Got it, will test that. Is there any way you could share the code from the OW extensions that is used to do this?

I’ve had a look into edge.js, but it only lets you call specific functions with predefined signatures. As far as I could see, there was no way to handle the Action global events that are defined in the plugin without rewriting another layer on top of it.

I’m not sure I want to go down the rabbit hole of building custom node.js extensions for this either, so I think that for now I’ll stick with not doing full integration tests, and I’ll completely mock the C# layer.
If at some point you have an easy way to integrate the custom plugins, that would be cool (should I open a feature request for this?).

Thanks again for your help!

@sebastientromp you can open a feature request of course.