tanem / react-svg

:art: A React component that injects SVG into the DOM.

Home Page:https://npm.im/react-svg

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

getting error while using jest and enzyme.

KPSoftec opened this issue · comments

console.error
Error: Error: connect ECONNREFUSED 127.0.0.1:80
at Object.dispatchError (Project-directory\node_modules\jsdom\lib\jsdom\living\xhr\xhr-utils.js:63:19)
at Request. (Project-directory\node_modules\jsdom\lib\jsdom\living\xhr\XMLHttpRequest-impl.js:655:18)
at Request.emit (node:events:406:35)
at ClientRequest. (Project-directory\node_modules\jsdom\lib\jsdom\living\helpers\http-request.js:121:14
)
at ClientRequest.emit (node:events:394:28)
at Socket.socketErrorListener (node:_http_client:447:9)
at Socket.emit (node:events:394:28)
at emitErrorNT (node:internal/streams/destroy:157:8)
at emitErrorCloseNT (node:internal/streams/destroy:122:3)
at processTicksAndRejections (node:internal/process/task_queues:83:21) undefined

Hi @KPSoftec. This library makes AJAX requests for SVGs under the hood, so you'll need to handle those in your tests. Here's an example using nock.

Closing due to inactivity.