microsoftly/BotTester

Deep match is not working

Closed this issue · 4 comments

I'm trying to make deepMatch work but I always get false positives.

I saw this https://github.com/microsoftly/BotTester/blob/master/test/BotTester.spec.ts#L185

If I change the user id in the test it always works. Not sure what is the problem. Have tried using chai-subset and I'm getting the same issue. Any ideas @microsoftly ?

That's interesting. I'll look into it. I found it a bit hard initially to find something that could do the deep matching well.

What may be a better solution is to break down IMessage into each component (text, address, type, etc .... ) then check against each of those and throw an error when one of them doesn't match (if defined in the expectation). That would definitely give better error reporting too instead of a giant blob of red

Yep, breaking the IMessage probably would be better but I think the deep match should be fine for the moment. The problem as I mentioned is that is not working correctly :(. Let me know if you find anything please!