bespoken / virtual-alexa

:robot: Easily test and debug Alexa skills programmatically
https://bespoken.io
Apache License 2.0
112 stars 35 forks source link

Shouldn't mocking DynamiDB also intercept savePersistentAttributes() calls from hitting the DynamoDB? #86

Closed prosellen closed 6 years ago

prosellen commented 6 years ago

I'm working testing a skill that uses attributesManager.savePersistentAttributes() to save user inupt.

Since this ueses DynamoDB, shouldn't those calls also be mocked when using virtualAlexa.dynamoDB().mock();?

And if not, what should I do to prevent hitting the DB while testing my skill?

jkelvie commented 6 years ago

Hi @prosellen - these should be locked. Why do you think they are not? Please also include a sample of the test code you have written.

prosellen commented 6 years ago

Well, actually, yes ... yes they do. They mock very efficiently.

After trying to recreate the behavior in a fresh project from which I could actually share come code, I realized that someone (who is most definitely not me!) needs to configure all of his tests right.

So, long story short: I feel stupid for opening an issue before trying to single out the problem and will learn my lesson out of this.

Mea culpa.