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
Refactor production tests #8073
Conversation
|
||
- name: Run Tests (Linux and Windows) | ||
if: matrix.os != 'macos-latest' | ||
run: yarn test:dist --maxWorkers=2 | ||
|
||
standalone: |
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'll try to merge production-test
and standalone-test
later.
const ENABLE_CODE_COVERAGE = !!process.env.ENABLE_CODE_COVERAGE; | ||
if (process.env.NODE_ENV === "production") { |
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 don't think use NODE_ENV
environment is a good idea, maybe change to another variable later
I don't understand this part. Why do we have to modify that file to add that test? If anything, I thought we would modify |
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.
Overall I'm good with this PR.
How to run full |
Anyway, I think better in this way.
This is much easier. |
By wrapping them in a loop. But I think just one test for that fallback would be enough. |
After a second thought, I think it's okay to test it in a separate step of the GitHub Actions workflow. It just feels unusual to me. |
# Conflicts: # scripts/test-dist.js
jest.config.js
(can't figure a better way).STANDALONE
tests to the same way asproduction-test
In this way, we can add more seperate tests on bundles.
To make this test runs on bundles:
Without this change, we have to modify
scripts/test-dist.js
add moreif/else
Now, We only need
cross-env PRETTIER_FALLBACK_RESOLVE=1 jest tests_integration/__tests__/{config-resolution,config-invalid,plugin-resolution}.js
to run tests on sourcecross-env NODE_ENV=production PRETTIER_FALLBACK_RESOLVE=1 jest tests_integration/__tests__/{config-resolution,config-invalid,plugin-resolution}.js
to run tests on bundlesAlso easier to run production tests with pattern
npx cross-env NODE_ENV=production jest tests/big-int
I’ve read the contributing guidelines.
✨Try the playground for this PR✨