Skip to content
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

[Testing] Support Jest --config extensibility #564

Closed
thedavidprice opened this issue May 19, 2020 · 1 comment
Closed

[Testing] Support Jest --config extensibility #564

thedavidprice opened this issue May 19, 2020 · 1 comment

Comments

@thedavidprice
Copy link
Contributor

related to #502
original conversation here in #521

Goal:

if additional Jest config is needed, add the capability for simple config extension managed from either App root or specific to App sides (e.g. web/, api/, etc.).

From @RobertBroersma
Option 1: a simple near-term solution is to document

Atm you could extend the config by directly importing the jest config from core and merging it with your local jest config, however this is Currently undocumented

Option 2: improved solution

I'm thinking along the way of exposing the Redwood jest config(s) as a function that you could call. Something like:

import { createJestConfig } from '@redwoodjs/core' (or @redwoodjs/testing)

export default createJestConfig({
 ...myCustomStuff,
})

Targeting Sides (TBD)

About targeting different sides; I thought it could be good to use Jest's [projects](Jest --config extensibility) config instead of running all sides in the command, so we offload more stuff to the Jest side, and new sides with their own jest.configs are automatically picked up!

Add Jest Watch (TODO)

One more thing I'd also like to do in the future is add https://github.com/jest-community/jest-watch-typeahead to the base config. This of course requires yarn rw test to work with watch!

@peterp
Copy link
Contributor

peterp commented Jul 22, 2020

This was handled by @RobertBroersma

@peterp peterp closed this as completed Jul 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants