Closed priyeshvadhiya closed 5 years ago
Hi,
you are using axios-mock-adapter, not this project (jest-mock-axios). So you're wrong here, maybe someone can help you there.
However, you could replace axios-mock-adapter with jest-mock-axios . In this case, please refer to the README on how to use jest-mock-axios and report back if there is still an issue.
i am setting up unit test with jest in my vuejs project.
testing with login component and i have tested successful all the props, input, client validation, but when i test with axios request POST then always return catch error
Error: Request failed with status code 404
i am setting up unit test with jest in my vuejs project.
testing with login component and i have tested successful all the props, input, client validation, but when i test with axios request POST then always return catch error
Error: Request failed with status code 404
login.spec.js
my test code
Login.vue
i am trying to lot. how to moke axios by calling method? positive answer appreciate
i want to call function and then call api(inside the function) and get response. wrapper.vm.doSigninNormal()
i have also post on stackOverflow to describe it.