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

chore(core): Add jest config back to rwjs/core #4461

Merged
merged 7 commits into from
May 3, 2022

Conversation

dac09
Copy link
Collaborator

@dac09 dac09 commented Feb 14, 2022

Related to #4334

Adds jest config for rwjs/core

We had a test in the @redwoodjs/core but no jest config, and no script to actually run it. :S Adds jest stuff back so the test actually runs (also updated the test)

@dac09 dac09 added the release:chore This PR is a chore (means nothing for users) label Feb 14, 2022
Copy link
Contributor

@thedavidprice thedavidprice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this include a test for stubbing an env var without a value to prevent another regression?

Copy link
Collaborator Author

dac09 commented Feb 14, 2022

If you look at the test DP, unfortunately it doesn't seem possible (to me, right now) to test this without running a full webpack build when we use the third party dotenv plugin

I was able to add the extra test in the previous PR because I'd changed our code that handled dotenv loading.

@thedavidprice
Copy link
Contributor

@dac09 Understood, and this brings up some of the things I wanted to discuss related to #4334

  1. I suggest we prioritize implementation according to preventing regression. This is how we ended up here in the first place — an innoucuous one line config change that broke apps. We need to prevent the same break from happening again.
  2. So I'm all for custom implementation when it allows us to test and prevent regression
  3. As far as removing DotEnv, I wanted to discuss edge cases where removing it might still break existing apps. Personally, I can't think of any, but the problem is we can't test for it. So my suggestion was to leave it enabled as is — or, maybe, we schedule it for deprecation and testing via the ultimat RC before 1.0.0 release.

@thedavidprice
Copy link
Contributor

thedavidprice commented Mar 1, 2022

@dac09
I think getting this in is better than not, but it doesn't really resolve my concerns re: preventing regression and having coverage that simulates the behavior we intend.

I'm approving this, but I do want us to prioritize a next step, which would preferrably be a PR (but Issue ok).

Here's the approach I suggest as a next step:

  1. outline the behavior we intend and expect (I've started that process by auditing existing behavoir over here Audit Web Environment Variables DX and Current Functionality #4503)
  2. creating the tests we need to cover all expected behavior (even if psuedo code): toml, prefix, stubbing, should not exist, etc.
  3. then modifying the config and plugins to a) be able to run the tests and b) get the tests passing

We'll need to address:

  • contexts; e.g. local dev vs production deploy
  • currently .env.default (package dotenv-defaults) is configured via CLI package code and not webpack
  • reconciling the two webpack config approaches we currently have — define plugin vs. DotEnv — and how to integrate/resolve (because we don't need both, do we?)

…-core-tests

* 'main' of github.com:redwoodjs/redwood: (668 commits)
  Fix broken link in authentication.md (redwoodjs#5394)
  Update local-postgres-setup.md (redwoodjs#5353)
  modify typescript example (redwoodjs#5377)
  fix(deps): update dependency core-js to v3.22.3 (redwoodjs#5376)
  fix(deps): update dependency @types/node to v16.11.32 (redwoodjs#5374)
  fix(deps): update prisma monorepo to v3.13.0 (redwoodjs#5375)
  chore(deps): update dependency typescript to v4.6.4 (redwoodjs#5372)
  chore(deps): update dependency nodemon to v2.0.16 (redwoodjs#5364)
  fix(docs): add WindiCSS in setup ui list (redwoodjs#5369)
  chore(deps): update dependency @nhost/nhost-js to v1.1.6 (redwoodjs#5363)
  Add back git fetch step for lerna
  chore(deps): update dependency @clerk/clerk-sdk-node to v3.3.10 (redwoodjs#5358)
  fix(deps): update dependency @types/node to v16.11.28 (redwoodjs#5326)
  update all contributors (redwoodjs#5357)
  Patch all-contributors-cli (redwoodjs#5356)
  Remove unused `SubmitHandler` in example JavaScript code (redwoodjs#5352)
  Use GraphQL Codegen to generate more accurate resolver types (redwoodjs#5216)
  chore(deps): update dependency @clerk/clerk-sdk-node to v3.3.8 (redwoodjs#5345)
  fix(deps): update dependency jest-watch-typeahead to v1.1.0 (redwoodjs#5339)
  Update yarn.lock
  ...
@netlify
Copy link

netlify bot commented May 2, 2022

Deploy Preview for redwoodjs-docs canceled.

Name Link
🔨 Latest commit a4b0f7f
🔍 Latest deploy log https://app.netlify.com/sites/redwoodjs-docs/deploys/627143548031c90008e0a121

@dac09 dac09 enabled auto-merge (squash) May 3, 2022 14:54
@dac09 dac09 merged commit 00af489 into redwoodjs:main May 3, 2022
@jtoar jtoar modified the milestones: next-release, v1.4.0 May 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:chore This PR is a chore (means nothing for users)
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants