Doesn't work with jest
See original GitHub issueI keep hitting these errors when rendering a component
console.error ../../node_modules/jsdom/lib/jsdom/virtual-console.js:29
Error: Error: connect ECONNREFUSED 127.0.0.1:80
at Object.dispatchError (/home/marcus-sa/Git/siteattention/dashboard/node_modules/jsdom/lib/jsdom/living/xhr-utils.js:54:19)
at Request.<anonymous> (/home/marcus-sa/Git/siteattention/dashboard/node_modules/jsdom/lib/jsdom/living/xmlhttprequest.js:675:20)
at Request.emit (events.js:214:15)
at Request.onRequestError (/home/marcus-sa/Git/siteattention/dashboard/node_modules/request/request.js:881:8)
at ClientRequest.emit (events.js:209:13)
at Socket.socketErrorListener (_http_client.js:406:9)
at Socket.emit (events.js:209:13)
at emitErrorNT (internal/streams/destroy.js:91:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
at processTicksAndRejections (internal/process/task_queues.js:77:11) undefined
Error: Failed: "Failed to load users.component.html"
Error:
at Env.it (/home/marcus-sa/Git/siteattention/dashboard/node_modules/jest-jasmine2/build/jasmineAsyncInstall.js:91:24)
at it (/home/marcus-sa/Git/siteattention/dashboard/node_modules/jest-jasmine2/build/jasmine/jasmineLight.js:93:21)
at env.<computed> (/home/marcus-sa/Git/siteattention/dashboard/node_modules/jest-preset-angular/zone-patch/index.js:84:27)
at /home/marcus-sa/Git/siteattention/dashboard/libs/users/src/lib/users.component.spec.ts:30:3
at ZoneDelegate.invoke (/home/marcus-sa/Git/siteattention/dashboard/node_modules/zone.js/dist/zone.js:396:30)
at Zone.run (/home/marcus-sa/Git/siteattention/dashboard/node_modules/zone.js/dist/zone.js:153:47)
at Suite.<anonymous> (/home/marcus-sa/Git/siteattention/dashboard/node_modules/jest-preset-angular/zone-patch/index.js:40:21)
at addSpecsToSuite (/home/marcus-sa/Git/siteattention/dashboard/node_modules/jest-jasmine2/build/jasmine/Env.js:496:51)
at Env.describe (/home/marcus-sa/Git/siteattention/dashboard/node_modules/jest-jasmine2/build/jasmine/Env.js:466:11)
at describe (/home/marcus-sa/Git/siteattention/dashboard/node_modules/jest-jasmine2/build/jasmine/jasmineLight.js:81:18)
I’ve seen multiple issues where people wanted Jest support and it was added… But from what it looks like it doesn’t work?
jest-preset-angular
inlines all the HTML, so there’s really no reason for it to be doing a http request to get the template.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Troubleshooting - Jest
Use this guide to resolve issues with Jest. Tests are Failing and You Don't Know Why. Try using the debugging support built into...
Read more >npm test/ jest not working - Stack Overflow
When I do npm test /jest, I am getting the following error: > @ test /Users/suparnasoman/Downloads/create-react-app-master > node packages/react ...
Read more >Troubleshooting · Jest
Use this guide to resolve issues with Jest. Tests are Failing and You Don't Know Why #. Try using the debugging support built...
Read more >watch doesn't work · Issue #775 · facebook/jest - GitHub
If I run jest --watch in my project, it runs the tests once: Using Jest CLI v0.9.0, jasmine2, babel-jest PASS ...
Read more >Successfully Throwing Async Errors with the Jest Testing Library
The first thing I tried, which didn't work, was to mock error results from the functions passed into the validateUploadedFile() function. Makes ...
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
In the 2 diff apps that I’m using jest with angular I use this builder for the tests:
https://www.npmjs.com/package/@angular-builders/jest
You didn’t mention whether you are using this already or not but I hope this helps.
On Wed, Aug 21, 2019 at 9:37 PM Brandon Domingue notifications@github.com wrote:
@getsaf actually it was a problem with me not including html as a transform matcher for
ts-jest