-
Notifications
You must be signed in to change notification settings - Fork 603
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use any config files: backstop.json, backstop.js - Version 2 #1566
Conversation
Example: Create a backstop.config.js | ||
Example: Create a `backstop.config.js` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might be wrong, but I don't think this PR would automatically find a backstop.config.js
so this example should be changed to
Example: Create a `backstop.js`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is correct -- but I don't think this is necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no problem removing the file extension so that advanced users can easily interchange file types implicitly. This is how require() was intended to work.
The intention of init
is to...
- make it easy for novice users to get started with Backstop JS
- enable basic automated sanity testing
I am not inclined to add another file format generation to init
-- I don't think this moves the objectives forward. If anything -- awareness of js config option to me is more of a problem -- as measured by users' questions in this area. Perhaps emphasising this in the docs or in example code would more directly address the issue?
Imo I think this project should switch from So, my proposal would be:
|
Any consideration for using https://github.com/cosmiconfig/cosmiconfig? It might be nice to offload the work to a separate well-tested, fully-featured library and allow backdrop to give end-users the flexibility that they might expect coming from other ecosystem packages that use cosmiconfig. |
@maxfenton I would be willing to merge a PR for just this change. It opens up possibilities with the lightest touch. |
@garris I didn't hat time anymore I'll have a second look and let you know. |
I just made the change. Hope this is helpful. Will go out in next release. 944884b |
Use any config files: backstop.json, backstop.js whichever is found first.
Discussion here: #1482
Changes:
backstop.js
orbackstop.json
init
function to handle properly the initialization