miragejs / graphql

A library for handling GraphQL requests with Mirage JS
MIT License
74 stars 12 forks source link

connect ECONNREFUSED 127.0.0.1:4001 at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1300:16) #59

Open mrhouzlane opened 2 years ago

mrhouzlane commented 2 years ago

While running npm run test , I have this error :

Screenshot 2022-08-31 at 19 48 19

Environment : Ubuntu node version : v18.8.0

Screenshot 2022-08-31 at 19 50 00
jneurock commented 2 years ago

It looks like Mirage isn't set up quite right or possibly not properly intercepting network requests. Mirage should intercept network requests so you never get to this point. From the error you shared, there aren't any clues that point to one of those problems or the other.

mrhouzlane commented 2 years ago

It looks like Mirage isn't set up quite right or possibly not properly intercepting network requests. Mirage should intercept network requests so you never get to this point. From the error you shared, there aren't any clues that point to one of those problems or the other.

I have installed mirage : npm install --save-dev miragejs @miragejs/graphql

The error may is related to the port, but it is not obvious for this case.

jneurock commented 2 years ago

Did you configure Mirage after the install? If so, can you share the config? If not, you'll need to configure it to run when you want.