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
Post a Comment