Open PuzoLiang opened 5 years ago
Oh, my god. I make this little unit test of some component for three days. But it also continues to annoy me to tackle these issues. I'm sorry to my PM. LOl
Is it because the import
statements are not in the beginning of the file?
Is it because the
import
statements are not at the beginning of the file?
I don't know. I am new to take over the project.
I have the same problem with my Jest test using Vue 3 + TS and tiny-slider version 2.9.3
Issue description:
I set all should setups that jest needs. but when I test files, it always occurs that tiny-slider SyntaxError Demo link/slider setting:
There is my config file:
There are some words from @Izhaki, he said: Sometimes it happens (especially in React Native or TypeScript projects) that 3rd party modules are published as untranspiled. Since all files inside node_modules are not transformed by default, Jest will not understand the code in these modules, resulting in syntax errors. To overcome this, you may use transformIgnorePatterns to whitelist such modules. You'll find a good example of this use case in React Native Guide.
But I do it as he said, it seems not to work as well. So, can you give me some advice on what happened? Tiny-slider version: 2.8.6 Browser name && version: ... OS name && version: ...