-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Configure Jest dynamically per side #805
Configure Jest dynamically per side #805
Conversation
I prefer the simpler approach as well. And I wonder, could we make |
@Tobbe Oooh that sounds like a good idea! |
@RobertBroersma I like your idea of adding the configuration file to a project; and I really like the way that you've got a function to grab that config, what do you think of making it more generic? const { getConfig } = require('@redwoodjs/core')
module.exports = getConfig({ type: 'jest', target: 'browser' }) |
I think that's a good idea, @peterp ! |
I've updated this with the simpler approach as discussed! Check this repo for the Does this I'll do a short writeup of some assumptions/default config I did in the config functions and in the |
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'm really struggling to see the value versus the complexity introduce via this PR.
Can you elaborate on what you find more complex in this situation? In my mind I just moved a few things around and made it less complex! Perhaps I can shine light on some stuff or maybe I'm in too deep. |
@RobertBroersma The stuff related to the type of VCS you're using really threw me off, I'll take another look with some fresh eyes in the morning. |
It looks good to me! We just need to confirm that the changes to using the absolute paths for the main babel |
My bad! Can be removed. Thought I did. |
I've been reading about paths, which always gets my windows spidey senses tingling... Want me to test-run anything on win? |
@Tobbe If you can run |
👋
This works, but only by circumventing an alleged bug in Jest.
A simpler way to do this would be to require the user to define a
jest.config
file for every side that they create. This could be generated bycreate-redwood-app
or byyarn rw generate side
(or w/e @peterp has in store for us!). This way the main config for the test command can be simplified to just pick up any project (jest.config
) inside of the user's monorepo.The file contents could be defaulted to something like
Upsides to this simpler approach:
jest.config
files provide an excellent entry point for extending configs.The biggest downside to that would be that existing projects would have to add these configs manually.
@peterp @thedavidprice @ others, what do you think? Typing this all out pretty much convinced myself the simpler approach is better, but I'd love to hear what you think 😄
Benefits:
TODO Before merge: