Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to simulate a linked account? #101

Closed
westlakem opened this issue Feb 4, 2019 · 2 comments
Closed

How to simulate a linked account? #101

westlakem opened this issue Feb 4, 2019 · 2 comments

Comments

@westlakem
Copy link

Is your feature request related to a problem? Please describe.
We are trying to unit test a feature that requires account linking.

Describe the solution you'd like
A way to simulate an account linked device that is able to hit Amazon's profile APIs (we need to hit their APIs once "account linked"

@jkelvie
Copy link
Member

jkelvie commented Feb 5, 2019

If you set the access token on the context, it will emulate a user who has linked their account:
virtualAlexa.context().setAccessToken(testSuite.accessToken);

We do not have builtin mocks for the profile API, but you we have them for the Address API - a similar approach using Nock (a great mocking tool) will work for the Profile API:
https://github.com/bespoken/virtual-alexa/blob/master/src/external/AddressAPI.ts#L67

@jkelvie jkelvie closed this as completed Feb 27, 2019
@westlakem
Copy link
Author

Ok, I was looking for mocks of the profile api.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants