@@ -687,7 +687,7 @@ describe("Engine: event", () => {
687687      await  engine . run ( ) ; 
688688      const  ruleResult  =  successSpy . mock . calls [ 0 ] [ 2 ] ; 
689689      const  expected  = 
690-         '{"conditions":{"priority":1,"any":[{"name":"over 21","operator":"greaterThanInclusive","value":21,"fact":"age","factResult":21,"result":true},{"operator":"equal","value":true,"fact":"qualified","factResult":false,"result":false}]},"event":{"type":"setDrinkingFlag","params":{"canOrderDrinks":true}},"priority":100,"result":true}' ; 
690+         '{"conditions":{"priority":1,"any":[{"name":"over 21","operator":"greaterThanInclusive","value":21,"fact":"age","factResult":21,"valueResult":21," result":true},{"operator":"equal","value":true,"fact":"qualified","factResult":false,"valueResult":true ,"result":false}]},"event":{"type":"setDrinkingFlag","params":{"canOrderDrinks":true}},"priority":100,"result":true}' ; 
691691      expect ( JSON . stringify ( ruleResult ) ) . toBe ( expected ) ; 
692692    } ) ; 
693693  } ) ; 
@@ -696,7 +696,7 @@ describe("Engine: event", () => {
696696    beforeEach ( ( )  =>  setupWithConditionReference ( ) ) 
697697    it ( 'serializes properties' ,  async  ( )  =>  { 
698698      const  {  results : [ ruleResult ]  }  =  await  engine . run ( ) 
699-       const  expected  =  '{"conditions":{"priority":1,"any":[{"priority":1,"all":[{"name":"over 21","operator":"greaterThanInclusive","value":21,"fact":"age","factResult":21,"result":true}]}]},"event":{"type":"awesome"},"priority":100,"result":true}' 
699+       const  expected  =  '{"conditions":{"priority":1,"any":[{"priority":1,"all":[{"name":"over 21","operator":"greaterThanInclusive","value":21,"fact":"age","factResult":21,"valueResult":21," result":true}]}]},"event":{"type":"awesome"},"priority":100,"result":true}' 
700700      expect ( JSON . stringify ( ruleResult ) ) . toEqual ( expected ) 
701701    } ) 
702702  } ) 
@@ -707,7 +707,7 @@ describe("Engine: event", () => {
707707      const  {  results : [ ruleResult ]  }  =  await  engine . run ( ) 
708708      const  {  conditions : {  any : [ conditionReference ]  }  }  =  ruleResult 
709709      expect ( conditionReference . result ) . toEqual ( false ) 
710-       const  expected  =  '{"conditions":{"priority":1,"any":[{"name":"nameOfTheUndefinedConditionReference","condition":"conditionThatIsNotDefined"},{"name":"over 21","operator":"greaterThanInclusive","value":21,"fact":"age","factResult":21,"result":true}]},"event":{"type":"awesome"},"priority":100,"result":true}' 
710+       const  expected  =  '{"conditions":{"priority":1,"any":[{"name":"nameOfTheUndefinedConditionReference","condition":"conditionThatIsNotDefined"},{"name":"over 21","operator":"greaterThanInclusive","value":21,"fact":"age","factResult":21,"valueResult":21," result":true}]},"event":{"type":"awesome"},"priority":100,"result":true}' 
711711      expect ( JSON . stringify ( ruleResult ) ) . toEqual ( expected ) 
712712    } ) 
713713  } ) 
0 commit comments