You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey! To preface my issue, I am new to Svelte, and so this is my first time jumping through most of these hoops.
Following the Svelte guide for setting up a TypeScript project, I built myself a script to set up a minimal project with a single test for the "Hello World" App component that the default template comes with. I followed the testing setup guide from testing-library, which is what brought me here.
I can run the script to build a new project, cd into it, and run the test with yarn jest, and it passes. If I then edit the test file in any way, say adding an extra 'expect(5).toEqual(5);`, then the tests blow up at me and tell me that they "cannot find name 'test'" and ask me if I forgot to install type definitions.
If I remove the "offending" change, the issue persists. If I also delete the node_modules folder and run yarn install again, then the test will pass.
Here is a repository with an app fresh off the presses from the script, which I was just able to reproduce the issue with on my system (macOS 10.15.5).
I would hugely appreciate any help that you are able to give. Please let me know if you need any more information!
The text was updated successfully, but these errors were encountered:
I'm a bit late but maybe it can help someone else who is struggling on this like me. I had the same issue (except that the errors for me were consistent) and tried following the steps TypeScript was writing, adding jest to types. However after adding it, I had another error regarding svelte and saw that the base tsconfig (the one that is extended from @tsconfig/svelte/tsconfig.json) had svelte to the types array, so I needed to specify both jest and svelte, like this:
After looking at your tsconfig.json and saw that you didn't specify the types option. I would recommend trying adding this and see if this helps. I can't really explain the inconsistent errors but hopefully the errors will be consistently gone for you after adding this option.
Hey! To preface my issue, I am new to Svelte, and so this is my first time jumping through most of these hoops.
Following the Svelte guide for setting up a TypeScript project, I built myself a script to set up a minimal project with a single test for the "Hello World" App component that the default template comes with. I followed the testing setup guide from testing-library, which is what brought me here.
I can run the script to build a new project, cd into it, and run the test with
yarn jest
, and it passes. If I then edit the test file in any way, say adding an extra 'expect(5).toEqual(5);`, then the tests blow up at me and tell me that they "cannot find name 'test'" and ask me if I forgot to install type definitions.If I remove the "offending" change, the issue persists. If I also delete the node_modules folder and run
yarn install
again, then the test will pass.Here is a repository with an app fresh off the presses from the script, which I was just able to reproduce the issue with on my system (macOS 10.15.5).
I would hugely appreciate any help that you are able to give. Please let me know if you need any more information!
The text was updated successfully, but these errors were encountered: