Skip to content

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.


:::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