You can set the default adapter for axios in your test setup file.
In package.json
{
"jest": {
"setupTestFrameworkScriptFile": "<rootDir>/test-setup.js",
}
}
And then in test-setup.js
const path = require('path');
const axios = require('axios');
const adapterPath = path.join(
path.dirname(require.resolve('axios')),
'lib/adapters/http'
);
const adapter = require(adapterPath);
axios.defaults.adapter = adapter;