Custom matchers are working when running my tests, but not available in my typedefs/autocomplete in vscode #670
              
                Unanswered
              
          
                  
                    
                      thepuzzlemaster
                    
                  
                
                  asked this question in
                Q&A
              
            Replies: 1 comment
-
| Ugh. I needed to install the typedefs 🤦 Sadly, this wasn't showing up as an error in my tsconfig.spec.json, but when I tried adding the  | 
Beta Was this translation helpful? Give feedback.
                  
                    0 replies
                  
                
            
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to add custom jest matchers to my Angular project. It seems like everything is set up correctly, but I can't get vscode to recognize the custom matchers in my spec files. If I manually
import '@testing-library/jest-dom';in my test file, then it works fine. But if I try to rely on that import coming from myjest-setup.tsfile, I get red squiggles on my custom matchers. If I run the tests, they all pass with the custom matchers, so the import from my setup file is working. But it's just not being recognized by vscode. I've tried restarting the IDE, and resetting the TS server, but no changes there.And my test file in question is located at:
src/components/user-menu/user-menu.component.spec.tsAny thoughts what might be going on here?
My tsconfig.spec.json:
My jest-setup.ts:
Beta Was this translation helpful? Give feedback.
All reactions