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

Created on 14 Feb 2020  ยท  5Comments  ยท  Source: smooth-code/jest-puppeteer

๐Ÿš€ 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 ๐Ÿ˜ƒ

enhancement โœจ

Most helpful comment

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

All 5 comments

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.

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

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

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

Awesome @igneel64 that is great.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

joshpitzalis picture joshpitzalis  ยท  3Comments

Pyrolistical picture Pyrolistical  ยท  6Comments

timwis picture timwis  ยท  5Comments

ifiokjr picture ifiokjr  ยท  5Comments

paperbackdragon picture paperbackdragon  ยท  4Comments