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

refactor(jest-config)!: do not normalize long deprecated configuration options #12701

Merged
merged 4 commits into from
Apr 20, 2022
Merged

refactor(jest-config)!: do not normalize long deprecated configuration options #12701

merged 4 commits into from
Apr 20, 2022

Conversation

mrazauskas
Copy link
Contributor

Summary

Perhaps it is time to remove normalization logic for long deprecated options? Looking at changelog:

preprocessorIgnorePatterns deprecated since Jest 17
scriptPreprocessor deprecated since Jest 17
setupTestFrameworkScriptFile deprecated since Jest 24
testPathDirs deprecated since Jest 19

They are needed in types, just for normalization logic. I was playing with schema generator, got somewhere with that (; The question is: what to do with deprecated options? Should they stay in schema? Maybe not... So, time to say goodbye?

Deprecation warnings are left in place. These look useful, I am just suggesting to get rid of normalization.

Test plan

Unit test is refactored. All should pass.

@@ -1108,12 +1108,6 @@ If you want a path to be [relative to the root directory of your project](#rootd

For example, Jest ships with several plug-ins to `jasmine` that work by monkey-patching the jasmine API. If you wanted to add even more jasmine plugins to the mix (or if you wanted some custom, project-wide matchers for example), you could do so in these modules.

:::info

`setupTestFrameworkScriptFile` is deprecated in favor of `setupFilesAfterEnv`.
Copy link
Contributor Author

@mrazauskas mrazauskas Apr 20, 2022

Choose a reason for hiding this comment

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

Hm.. I was sure this note was removed long time ago ;D

describe('testURL', () => {
beforeEach(() => {
jest.mocked(console.warn).mockImplementation(() => {});
describe('shards', () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Simply got moved up


it('logs a deprecation warning when `testURL` is used', async () => {
describe('logs a deprecation warning', () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

All warnings in one place.

Copy link
Member

@SimenB SimenB left a comment

Choose a reason for hiding this comment

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

Awesome! Definitely time to remove

@SimenB SimenB merged commit f60f84e into jestjs:main Apr 20, 2022
@mrazauskas mrazauskas deleted the refactor-config-normalize branch April 20, 2022 16:39
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants