We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
import axios from 'axios'; import MockAdapter from 'axios-mock-adapter'; const instance = axios.create({ adapter: config => { console.log('no run'); return axios({ ...config, adapter: undefined }); }, }); const mock = new MockAdapter(instance); mock.onGet('/users').reply(config => { return new Promise(resolve => { setTimeout(() => { resolve([200, { timeout: config.timeout }]); }, config.timeout); }); }); instance.get('/users').then(data => { console.log('data', data); });
The text was updated successfully, but these errors were encountered:
What's the question here? console.log('no run'); isn't logged. The adapter never gets called as it gets mocked with new MockAdapter(instance)
console.log('no run');
new MockAdapter(instance)
Sorry, something went wrong.
No branches or pull requests
The text was updated successfully, but these errors were encountered: