diff --git a/bootstrap.js b/bootstrap.js index e9b63de5..0204420c 100644 --- a/bootstrap.js +++ b/bootstrap.js @@ -1 +1 @@ -require('./dist/index').bootstrap({}); +require('./dist/index').bootstrap(); diff --git a/src/routines/bootstrap.js b/src/routines/bootstrap.js index 7383165d..88a0b5ba 100644 --- a/src/routines/bootstrap.js +++ b/src/routines/bootstrap.js @@ -29,6 +29,10 @@ type ConfigurationType = {| +environmentVariableNamespace: string |}; +const defaultConfigurationInput = { + environmentVariableNamespace: undefined +}; + const log = Logger.child({ namespace: 'bootstrap' }); @@ -43,7 +47,7 @@ const createConfiguration = (configurationInput: ConfigurationInputType): Config }; }; -export default (configurationInput: ConfigurationInputType) => { +export default (configurationInput: ConfigurationInputType = defaultConfigurationInput) => { const configuration = createConfiguration(configurationInput); global.GLOBAL_AGENT = global.GLOBAL_AGENT || createGlobalAgentGlobal(); diff --git a/test/global-agent/routines/bootstrap.js b/test/global-agent/routines/bootstrap.js index c318d9b1..e2594515 100644 --- a/test/global-agent/routines/bootstrap.js +++ b/test/global-agent/routines/bootstrap.js @@ -151,7 +151,7 @@ const createHttpServer = async () => { }; test('proxies HTTP request', async (t) => { - bootstrap({}); + bootstrap(); const proxyServer = await createProxyServer(); @@ -165,7 +165,7 @@ test('proxies HTTP request', async (t) => { }); test('proxies HTTPS request', async (t) => { - bootstrap({}); + bootstrap(); const proxyServer = await createProxyServer(); @@ -179,7 +179,7 @@ test('proxies HTTPS request', async (t) => { }); test('does not produce unhandled rejection when cannot connect to proxy', async (t) => { - bootstrap({}); + bootstrap(); const port = await getNextPort(); @@ -189,7 +189,7 @@ test('does not produce unhandled rejection when cannot connect to proxy', async }); test('proxies HTTPS request with dedicated proxy', async (t) => { - bootstrap({}); + bootstrap(); const proxyServer = await createProxyServer(); @@ -203,7 +203,7 @@ test('proxies HTTPS request with dedicated proxy', async (t) => { }); test('ignores dedicated HTTPS proxy for HTTP urls', async (t) => { - bootstrap({}); + bootstrap(); const proxyServer = await createProxyServer(); @@ -218,7 +218,7 @@ test('ignores dedicated HTTPS proxy for HTTP urls', async (t) => { }); test('forwards requests matching NO_PROXY', async (t) => { - bootstrap({}); + bootstrap(); const proxyServer = await createProxyServer(); const httpServer = await createHttpServer(); @@ -234,7 +234,7 @@ test('forwards requests matching NO_PROXY', async (t) => { }); test('proxies HTTP request (using http.get(host))', async (t) => { - bootstrap({}); + bootstrap(); const proxyServer = await createProxyServer(); @@ -250,7 +250,7 @@ test('proxies HTTP request (using http.get(host))', async (t) => { }); test('proxies HTTP request (using got)', async (t) => { - bootstrap({}); + bootstrap(); const proxyServer = await createProxyServer(); @@ -262,7 +262,7 @@ test('proxies HTTP request (using got)', async (t) => { }); test('proxies HTTPS request (using got)', async (t) => { - bootstrap({}); + bootstrap(); const proxyServer = await createProxyServer(); @@ -274,7 +274,7 @@ test('proxies HTTPS request (using got)', async (t) => { }); test('proxies HTTP request (using axios)', async (t) => { - bootstrap({}); + bootstrap(); const proxyServer = await createProxyServer(); @@ -286,7 +286,7 @@ test('proxies HTTP request (using axios)', async (t) => { }); test('proxies HTTPS request (using axios)', async (t) => { - bootstrap({}); + bootstrap(); const proxyServer = await createProxyServer(); @@ -298,7 +298,7 @@ test('proxies HTTPS request (using axios)', async (t) => { }); test('proxies HTTP request (using request)', async (t) => { - bootstrap({}); + bootstrap(); const proxyServer = await createProxyServer(); @@ -316,7 +316,7 @@ test('proxies HTTP request (using request)', async (t) => { }); test('proxies HTTPS request (using request)', async (t) => { - bootstrap({}); + bootstrap(); const proxyServer = await createProxyServer();