Skip to content

0.35.0

Compare
Choose a tag to compare
@aliokan aliokan released this 19 Feb 15:28
· 4 commits to master since this release
c0e6e7d

Features

  • Unit tests are generated at compile time. It removes the need of reflection at runtime and allows better compilation workflow (ie: Use Closure compiler in advanced mode).
  • Mappings consistency are checked at compile time in Flow DSL between mapped type and: Class name, reference or primitive value.
  • bind added to Flow DSL. Mapping checking works with bind as well.
    See examples below:
@context
{
	recursive.f3 = sample.testBind.bind( _, i );
	recursive.f4 = hex.mock.Sample.testStaticBind.bind( _, i );
	
	@public
	binded = sample.testBind.bind( _, i );
	
	@public
	staticBinded = hex.mock.Sample.testStaticBind.bind( _, i );
	
	@public
	recursive = new hex.mock.ConstructorWithClosureArgs( sample.testBind.bind( _, i ), hex.mock.Sample.testStaticBind.bind( _, i ) );
	recursive.callWithClosureArgs( sample.testBind.bind( _, i ), hex.mock.Sample.testStaticBind.bind( _, i ) );
	result = hex.mock.ConstructorWithClosureArgs.staticallWithClosureArgs( sample.testBind.bind( _, i ), hex.mock.Sample.testStaticBind.bind( _, i ) );
	
	@public
	mapping1 = mapping( { fromType: "String->String", toValue: binded } );
	
	@public
	mapping2 = mapping( { fromType: "String->String", toValue: hex.mock.Sample.testStaticBind.bind( _, i ) } );
	
	sample = new hex.mock.Sample();
	i = 3;
}
  • ExMachinaUnitCore.addRuntimeTest gives retro-behavior to add tests at runtime in the runner.
  • MacroUtil.getTypeFromString returns haxe.macro.Type from a given stringified fcqn.
  • MacroUtil.getIdent returns expr ident if there's one.

Breaking change

  • MethodRunner.asyncHandler( callback : Void->Void) should be used for asynchronous tests. It triggers the final callback for ending the asynchronous test.
    Example:
        Timer.delay( MethodRunner.asyncHandler( this._onCompleteTestAsyncTransitionsWithHandlers ), 200 );
       //becomes
        Timer.delay( MethodRunner.asyncHandler.bind( this._onCompleteTestAsyncTransitionsWithHandlers ) , 200 );

Example with argument callback

        acb.onComplete( MethodRunner.asyncHandler( this._onTestExecuteComplete, [ service, acb ] ) );
        //becomes
        acb.onComplete( function( result : String ) 
                MethodRunner.asyncHandler( function() this._onTestExecuteComplete( result, service, acb ) ) );

Enhancements

  • MacroUtil.getClassType can be called in silent mode (to prevent error throwing)
  • ReflectionBuilder throws exception for annotated virtual getters/setters.

Bugfixes

  • tink_macro dependency set to 16.1
  • Conflict between IsLoggable and IInjectable when they extend the same interface. #245

Experimental

  • hexCommand is still in development. The final goal is to deprecate hexIoC and hexMVC to go to final release without reflection.