jest-puppeteer icon indicating copy to clipboard operation
jest-puppeteer copied to clipboard

Adding package.json configuration option, or making the jest-puppeteer config path more flexible

Open igneel64 opened this issue 5 years ago • 5 comments

🚀 Feature Proposal

How about adding the option to add the configuration parameters directly to package.json as a "jest-puppeteer" field ?

Motivation

Currently the only place you can add the configuration is in the root of the project with the jest-puppeteer.config.js file. This seems a bit unyieldy and could be consider "yet another file" for most people with just 3-4 lines of configuration. The addition of the package.json config option is something that many other libraries provide e.g. jest, eslint and others. Certainly it is not so flexible as a JavaScript file, but could fit many cases.

Another consideration would be to be able to search for the jest-puppeteer.config.js recursively from the current file running, and use the first one found. This would make it a bit more "clean" as it would allow people to add the jest-puppeteer.config.js file, closer to where it would belong conceptually.

Note

If this is something wanted, I could begin working on a first implementation 😃

igneel64 avatar Feb 14 '20 18:02 igneel64

I would like to see this, more and more javascript tools are expecting custom configs in root and it really adds up quick. I've recently begun trying to move all my tooling configs into a subfolder in effort to clean up the root, and realized this tool doesn't yet support this.

StevenWeathers avatar Apr 23 '20 00:04 StevenWeathers

I would do my best to come with a PR in the coming days @StevenWeathers

igneel64 avatar Apr 23 '20 09:04 igneel64

I would love to see this as well. I am also annoyed bay having yet another config file with 3 options. 😁

lukasoppermann avatar May 02 '20 11:05 lukasoppermann

@lukasoppermann @StevenWeathers PR is open, if you could check it out it would probably speed up the process a bit 😄

igneel64 avatar May 04 '20 09:05 igneel64

Awesome @igneel64 that is great.

lukasoppermann avatar May 04 '20 09:05 lukasoppermann

Do you have any news please ?

yacineblr avatar Mar 06 '23 14:03 yacineblr

We will work on it.

gregberge avatar Mar 07 '23 08:03 gregberge

Supported in v8+. Docs also updated.

gregberge avatar Mar 08 '23 12:03 gregberge