BrianMacIntosh/alexa-skill-test-framework

withSessionAttributes Issue

rroobb opened this issue · 7 comments

I'm currently using version 1.2.4. It seems that when I try to set an existing session attribute using withSessionAttributes, it doesn't override it. If the session attribute is not an existing one then it gets properly set. I downloaded the latest changes from your master and this issue doesn't happen anymore, could you please release a new version?

1.2.4 is the latest version. What changes are in master, that fix it?

I am not sure what the broken behavior is. I understand that you want the withSessionAttributes to take precedence over the real session attributes in the sequence flow. Is this correct? Can you elaborate on the use case?

The broken behavior is that I'm not able to override a session attribute that is already set. Unless you have a reason of having that check, I created the pull request: #42

The idea behind this is to prefer session attributes set by the skill under test in a previous step instead of overwriting them. But your proposal is equally valid.

@dnetoMOB what do you think?

Unit tests should be deterministic, If you don't want to set a session attribute at one step, you can simply remove it from withSessionAttributes.