Pretty new to TestBox, but I'm trying to use it fr...
# testing
a
Pretty new to TestBox, but I'm trying to use it from a BoxLang class. I'm getting a
Function 'getComponentMetadata' not found
error for a lot of things I'm doing so this might be a generic error.
Copy code
private function runTests() {
    var javaSystem = createObject( "java", "java.lang.System" );
    var exerciseRoot = javaSystem.getProperty( "user.dir" );
    var testCFC = ArrayFirst( DirectoryList( path = exerciseRoot, filter = "*Test.cfc" ) );
    var testRunner = new testbox.system.TestBox( testCFC );
    var testData = testRunner.runRaw().getMemento();
    println( testData );
    // Set proper exit code
    if( testData.totalFail || testData.totalError ) {
        setExitCode( 1 );
    }
}
error message.txt
s
1. Do you have
bx-compat
module installed? 2. Are you using the
@be
version of TestBox?
👆 1
👍 1
a
I’m running the regular BoxLang install with nothing added and the stable version of TestBox. I’ll take a look at both suggestions
Copy code
private function runTests() {
        var javaSystem = createObject( "java", "java.lang.System" );
        var exerciseRoot = javaSystem.getProperty( "user.dir" );
        var testCFCs = DirectoryList( path = exerciseRoot, filter = "*Test.cfc" );
        var testRunner = new testbox.system.TestBox();
        var testData = testRunner.runRaw( bundles = testCFCs, eagerFailure = true ).getMemento();
        println( testData );
		// Set proper exit code
		if( testData.totalFail || testData.totalError ) {
			setExitCode( 1 );
		}
	}
I set up the bx-compat module and installed the bleeding edge TestBox, but I can't get past this error.