-
Is it possible to do something like this in adonisV5 to fake services for tests?
|
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 14 replies
-
If you can share the exact test code, then I can try to help on how to achieve this. The current example is too abstract |
Beta Was this translation helpful? Give feedback.
-
Hi! I have maybe the same question. import twilio from '@ioc:Services/Twilio'
export default class SomeController {
public async sendSms({ auth }: HttpContextContract) {
const user = auth.user
await twilio.sendSms(user.phone, 'message: Some text')
return response.apiSuccess()
}
} and I want to 'fake' this service method when tests are running. |
Beta Was this translation helpful? Give feedback.
-
@thetutlage Also the description for the fake method says:
Can it be an issue with the proxies? Or there should be some additional steps? While tests are running I've console logged the container and the proxiesEnabled property is false |
Beta Was this translation helpful? Give feedback.
-
@thetutlage The proposed answer with adding |
Beta Was this translation helpful? Give feedback.
@thetutlage Also the description for the fake method says:
Can it be an issue with the proxies? Or there should be some additional steps? While tests are running I've console logged the container and the proxiesEnabled property is false