reactjs - Services imported in index but API_URL is undefined in making test cases in index.test.js -


index.js

i imported import svc 'services/auth' in index.js , use function inside auth.js file. , works, when had created test case index.js. there error occured.

fail  app/containers/login/tests/index.test.js   ● test suite failed run  typeerror: cannot read property 'api_url' of undefined    @ new api (app/services/api.js:32:20)   @ object.<anonymous> (app/services/auth.js:5:11)   @ object.<anonymous> (app/containers/login/index.js:20:13)   @ object.<anonymous> (app/containers/login/tests/index.test.js:6:14)   @ process._tickcallback (internal/process/next_tick.js:109:7) 

how add or defined api_url in test case?


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -