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
Mock doesn't work inside of a class #231
Comments
@TooManyLogs I believe the issue here is that your class is not initialised and hence not picked up as a handler. Change the export statement to: class MyIntent {
async handle () {
await this.invoke('myParam');
}
invoke (paramName = {}) {
const params = {
paramName
};
return Client.invoke(params)
.promise()
.then(response =>
JSON.parse(response.Payload)
);
};
}
}
module.exports = new MyIntent(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, having some trouble getting mock to work inside a class.
In the following code the mock is not being called at all when testing class
This is an example of the class based approach i'm trying to test
The same code without class will run the mock when testing
The text was updated successfully, but these errors were encountered: