I am thinking of implementing a combinatorial sequence enumeration algorithm for asynchronous tests (exhaustive reachability testing). For that to work in the context of nodeunit, I need to generate multiple test cases dynamically from a single test function -- the total number of test cases to run cannot generally be determined until the test code executes at least once, possibly multiple times. Monkey patching core.runTest() is the only approach I came up with so far; is there a better way?
I am thinking of implementing a combinatorial sequence enumeration algorithm for asynchronous tests (exhaustive reachability testing). For that to work in the context of
nodeunit
, I need to generate multiple test cases dynamically from a single test function -- the total number of test cases to run cannot generally be determined until the test code executes at least once, possibly multiple times. Monkey patchingcore.runTest()
is the only approach I came up with so far; is there a better way?Example (runs
myTest
twice):