Problem with wirebox inside unit tests

Before upgrading to wireBox I actually had no problem with these tests, but now I get a variable not found.

First I have all my tests in a directory called unitTests, all other tests work except any that use the Execute(event). The unit tests directory is not in the webroot, and has all the correct mappings etc.

The problem that I see it as is that the mappings or bindings so to speak are getting confused, that’s the only way that I can describe this.

So if I have something like the following in my tests.

var event = execute(‘module:Comment.index’);

var result = event.getRenderData();

assertEquals(‘ok’,, ‘Was not able to create a comment.’ );

The event is fired and is run, but anything that should be DI’ed into the handler is not.

So the question is how should this work? Or more importantly do I need to do something special on the tests side for WireBox to do its magic?

The unitTests directory has an application.cfc that has a different name to the main application, and the remoteFacade also resides in this directory, if that helps and all the settings are correct for all other tests to work, just not in this scenario.


Andrew Scott

Can you post the errors Andrew, everything should load, so not really sure what your issue is.
Luis F. Majano
Ortus Solutions, Corp

ColdBox Platform:
Linked In:
IECFUG Manager:

The error is a standard variable pageService doesn’t exist, this is a DI property that is in the vent.

I am thinking that because the Application.cfc is inside the unitTests dir, that wireBox might be getting confused as to where to find the conventions, but I am only getting this problem with running events, everything else like getModel() will do the DI just fine.


Andrew Scott