Testing Modules

Hello Guys,

Embarking on my first adventures with Modules. I’m trying to understand how best to test them.

Putting the tests for a module into the standard app test folder doesn’t seem right, as the point of a module is that it’s portable, and I should be able to take it and drop it into any app, and the test should come with it.

But, there are also going to be certain components of my application which interact with the module, and those will need testing too.

My current thoughts are to have module specific unit tests inside the module folder, and integration tests for the specific application and the module in with the main app tests.

How do you guys handle testing for your modules?

Thanks,

Robert

I hit exactly the same predicament when I started doing modules, so welcome to the club :-).

The way I got around was to rearrange my test folder to something like this:-

TestSuite.cfm

  • myProject
  • modules
    – module1
    – module2

That way I didn’t have to create a completely new test area for Modules ( and all the headaches involved in doing that ) but at the same time I’ve still got the choice of running the whole lot at once OR just the project / module tests.

Cheers,
James

Hi James,

That’s a pretty solid approach and certainly makes good sense. I think I’ll do something like that!

Thanks bud,

Robert