script tag is not available while doing jest testing
public/index.html content
script src="config.js" //script tag
public/config.js content
window.appConfig = {
oboServicePath: 'some path'
}
axios.ts
const axiosOBOInstance = axios.create({
// @ts-ignore
adapter: cacheAdapterEnhancer(axios.defaults.adapter, {
defaultCache,
}),
baseURL: appConfig.getRequired('oboServicePath'),
Error at
appConfig.getRequired as window.appConfig is undefined
appConfig should be available @window scope.