Add jest config
See original GitHub issueReact folks often use Jest. I think it would be good to add it’s config by default.
I get lots of errors like:
3:1 'describe' is not defined. no-undef
4:3 'test' is not defined. no-undef
I guess better defaults would be to allow them in test files
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Configuring Jest
It is recommended to define the configuration in a dedicated JavaScript, TypeScript or JSON file. The file will be discovered automatically, if ...
Read more >How to write a Jest configuration file
If you want to use the package.json to configure jest, add the "jest" key and then your configuration. // package.json { "name" ...
Read more >Configuring package.json · Jest
Jest's configuration can be defined in the package.json file of your project or through the --config <path/to/json> option.
Read more >Adding a Jest Setup File - Test-Driven React [Book]
Adding a Jest Setup File Since this chapter's project will have three components (Carousel, CarouselButton, and CarouselSlide), it's going to have three ...
Read more >jest-config | Yarn - Package Manager
Jest will set process.env.NODE_ENV to 'test' if it's not set to something else. You can use that in your configuration to conditionally setup...
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 Free
Top 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
Hmm suddenly it’s working for me as well, I think it’s because I’ve experimented with .lyntrc and made something like this and forgot about it:
It seems such .lyntrc is incorrect overrides CLI flag (usually CLI flags have priority over configuration).
I guarantee that 90% of react devs are using Jest for testing. Also I think the discussion about these variables going non-global in Jest is not relevant, as status quo for this moment is that they are global and Lynt is supposed to be “Zero configuration by default” 😃