-
Notifications
You must be signed in to change notification settings - Fork 309
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Jest with Angular 7 SyntaxError: Unexpected token { #277
Comments
tsconfig.spec.json:
jest.config.js
|
Can you also share your |
sure, I am using Angular 7, Ionic 4/Cordova tsconfig.json
|
The problem is, that jest runs inside Before passing your files to jest, Packages in The solution to your problem is this, as suggested by the initial Jest message:
|
@wtho ok, thank you for your response. I will try and give that a try, again. I have tried so many things before wasting people's time here that I forgot all that I have tried. However, I tried to have all the node_modules be ignored but that didn't fix anything. Also,
so in order for it TO BE transformed you add it to the IGNORE patterns.... seems backwards no? |
The default configuration of the When overriding you will want to say "ignore everything in |
Thanks but it is still not transforming somethings, for example:
The error above is also repeated for the ngx-socket-io (which I have aded to the IgnorePatterns but does't appear to have taken effect. I have updated my config to:
sorry for being dense, 😅. I have also been running |
This won't work:
As stated in the docs:
Therefore You have to put them all in one pattern, otherwise anything not matching the first ignore pattern will be matched in another one: Yeah, running |
still not working. I have been trying:
I am trying to just ignore one file before I worry about two or three. I'm just trying the shotgun approach now because I am absolutely dumfounded by this. |
Ok, after that you are passing all of the
So try to add this to |
I had the |
how I have updated:jest.config.js
tsconfig.json
ts.config.spec.json
hope this will save someone many hours! |
Hi, there. After several hours of fighting with the same problem it successfully resolved with
Thanks @ctfrancia & @wtho But be careful, you could encounter an error |
I don't even know where to start with this one as I am not too familiar with testing and using this package for jest testing. I have about 27 fails and all have a variety of :
I have seen posts regarding '<' but haven't encountered one with '{' I have no idea where to even start with this.
read this and this oh and can't forget this
The text was updated successfully, but these errors were encountered: