MCPcopy
hub / github.com/axios/axios / requestWithConfig

Function requestWithConfig

tests/smoke/cjs/tests/auth.smoke.test.cjs:40–57  ·  view source on GitHub ↗
(config)

Source from the content-addressed store, hash-verified

38 });
39
40 const requestWithConfig = async (config) => {
41 server = await startServer((req, res) => {
42 res.setHeader('Content-Type', 'text/plain');
43 res.end(req.headers.authorization || '');
44 });
45
46 const { port } = server.address();
47
48 return axios.get(
49 `http://127.0.0.1:${port}/`,
50 Object.assign(
51 {
52 proxy: false,
53 },
54 config || {}
55 )
56 );
57 };
58
59 it('sets Basic Authorization header from auth credentials', async () => {
60 const response = await requestWithConfig({

Callers 1

Calls 4

setHeaderMethod · 0.80
endMethod · 0.80
getMethod · 0.80
startServerFunction · 0.70

Tested by

no test coverage detected