Dynamic Functions in JavaScript (nodejs)

Sorry I have been flat out for awhile ... but if you want to make some dynamic functions in javascript where you have the function name as a string ... check this out.

var theTests = require('./tests'); 
//@TODO CaseID should be caseId
var CaseID = 5678;
// use dynamic functions
var functionName = 'theTests.TEST_' + CaseID;
var functionString = String('TEST_' + CaseID);

var check = eval( 'typeof ' + functionName ); // bad
if ( check == 'function' ) {
    // run the function
    // testResult = eval( functionName ); nope
    testResult = theTests[functionString](); //yep :)
    console.log(testResult);
}
else {
    console.log( 'No test functions for ' + CaseID );
}

then in your test.js

TEST_5678: function(){
     return some thing;
},
Category: