license import { defineAction } from "../defineAction" ; describe ( "defineAction" , ( ) => { it ( "should return actions with correct type and payload" , ( ) => { const RemoveBar = defineAction ( "RemoveBar" ) < number > ( ) ; expect ( RemoveBar ( 4 ) ) . toEqual ( { type : "RemoveBar" , payload : 4 } ) ; } ) ; it ( "should allow no-arg invocation for `undefined` payload definitions" , ( ) => { const Reset = defineAction ( "Reset" ) ( ) ; expect ( Reset ( ) ) . toEqual ( { type : "Reset" , payload : undefined } ) ; } ) ; it ( "should correctly set `meta` when passing second argument" , ( ) => { const Reset = defineAction ( "Reset" ) ( ) ; expect ( Reset ( undefined , "meta" ) ) . toEqual ( { type : "Reset" , payload : undefined , meta : "meta" , } ) ; } ) ; } ) ;