Error when running karma without internet connection
See original GitHub issueExpected behavior
I would expect to be able to run unittests even when I do not have an internet connection available. My internet provider decided to ditch my connection today, I was working from home and I thought well, while they fix this I’ll go write some more unittests. No go. Apparently something goes wrong when it tries to lookup address information (which is not available).
Actual behavior
I get the following error:
C:\Users\project_name\node_modules\karma\lib\runner.js:65
throw e
^
Error: getaddrinfo ENOENT localhost:9877
at Object.exports._errnoException (util.js:849:11)
at errnoException (dns.js:31:15)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:77:26)
Enviroment Details
- Karma version (output of
karma --version
): 0.13.22 (reproducible on 1.3.0) - Relevant part of your
karma.config.js
file: None - Other info:
- Running Windows 10.
- Running this in Webstorm 11 (though it also happens running CLI commands).
See: https://github.com/RobertDiebels/karma-test/tree/master for further details.
Steps to reproduce the behaviour
- Disconnect from all your networks.
- run command
karma start
- run command
karma run --conf karma.conf.js --file jasmine-test.spec.js
- Behold the error message
This is reproducible on Karma version: 1.3.0 just ran the steps above again.
Issue Analytics
- State:
- Created 7 years ago
- Comments:14 (7 by maintainers)
Top Results From Across the Web
Why isn't my internet connection working? - Karma Mobility
Check your coverage. It's possible you're in an area without any. Our network partner is experiencing downtime. It's usually minor and should be...
Read more >Is it possible to run Karma with no browsers at all?
I'm doing my development via SSH into a remote machine, which I think (let me know if I'm wrong) is pointless to have...
Read more >Testing Angular Components with Stub Services and Spies in ...
Scenario: We'll be creating a component named students.component.ts. This component will handle below activities: Get the list of students from a service.
Read more >Testing services - Angular
Here are some synchronous and asynchronous unit tests of the ValueService written without assistance from Angular testing utilities. app/demo/demo.spec.ts
Read more >Run/Debug Configuration: Karma | IntelliJ IDEA Documentation
Install the Karma test runner as described in Karma. ... Build, no error check: the same as the Build option, but IntelliJ IDEA...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I can confirm that problem exist, but problem in
karma run
command onlykarma start
work as expected,karma run
does not work if disable networkConsider node-offline-localhost.
Add the following before the breaking code:
And it just works (hopefully), at least until RFC 3493 gets fixed.
Full disclosure: I authored this package to streamline https in my dev environment when offline.