Skip to content

Commit 42288c4

Browse files
authored
build(dev-deps): upgrade Jest to major version v30 (apache#33979)
1 parent c008190 commit 42288c4

File tree

46 files changed

+4649
-1276
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+4649
-1276
lines changed

.github/dependabot.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ updates:
1212
# not until React >= 18.0.0
1313
- dependency-name: "storybook"
1414
- dependency-name: "@storybook*"
15+
# JSDOM v30 doesn't play well with Jest v30
16+
# Source: https://jestjs.io/blog#known-issues
17+
# GH thread: https://github.com/jsdom/jsdom/issues/3492
18+
- dependency-name: "jest-environment-jsdom"
1519
directory: "/superset-frontend/"
1620
schedule:
1721
interval: "monthly"

superset-frontend/.eslintrc.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,7 @@ module.exports = {
8686
],
8787
parser: '@babel/eslint-parser',
8888
parserOptions: {
89-
ecmaFeatures: {
90-
experimentalObjectRestSpread: true,
91-
},
89+
ecmaVersion: 2018,
9290
},
9391
env: {
9492
browser: true,
@@ -127,6 +125,11 @@ module.exports = {
127125
'react-prefer-function-component',
128126
'prettier',
129127
],
128+
// Add this TS ESlint rule in separate `rules` section to avoid breakages with JS/TS files in /cypress-base.
129+
// TODO(hainenber): merge it to below `rules` section.
130+
rules: {
131+
'@typescript-eslint/prefer-optional-chain': 'error',
132+
},
130133
overrides: [
131134
{
132135
files: ['*.ts', '*.tsx'],
@@ -160,7 +163,7 @@ module.exports = {
160163
'@typescript-eslint/no-non-null-assertion': 0, // disabled temporarily
161164
'@typescript-eslint/explicit-function-return-type': 0,
162165
'@typescript-eslint/explicit-module-boundary-types': 0, // re-enable up for discussion
163-
'@typescript-eslint/prefer-optional-chain': 2,
166+
'@typescript-eslint/no-unused-vars': 'warn', // downgrade to Warning severity for Jest v30 upgrade
164167
camelcase: 0,
165168
'class-methods-use-this': 0,
166169
'func-names': 0,
@@ -395,6 +398,7 @@ module.exports = {
395398
},
396399
},
397400
],
401+
// eslint-disable-next-line no-dupe-keys
398402
rules: {
399403
'theme-colors/no-literal-colors': 'error',
400404
'icons/no-fa-icons-usage': 'error',

superset-frontend/cypress-base/cypress/e2e/dashboard/nativeFilters.noInitState.test.ts

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -21,30 +21,21 @@ import qs from 'querystring';
2121
import {
2222
dashboardView,
2323
nativeFilters,
24-
exploreView,
2524
dataTestChartName,
2625
} from 'cypress/support/directories';
2726

2827
import {
2928
addCountryNameFilter,
30-
addParentFilterWithValue,
3129
applyAdvancedTimeRangeFilterOnDashboard,
3230
applyNativeFilterValueWithIndex,
3331
cancelNativeFilterSettings,
34-
checkNativeFilterTooltip,
35-
clickOnAddFilterInModal,
36-
collapseFilterOnLeftPanel,
3732
deleteNativeFilter,
3833
enterNativeFilterEditModal,
39-
expandFilterOnLeftPanel,
4034
fillNativeFilterForm,
41-
getNativeFilterPlaceholderWithIndex,
4235
inputNativeFilterDefaultValue,
4336
saveNativeFilterSettings,
44-
nativeFilterTooltips,
4537
undoDeleteNativeFilter,
4638
validateFilterContentOnDashboard,
47-
valueNativeFilterOptions,
4839
validateFilterNameOnDashboard,
4940
testItems,
5041
WORLD_HEALTH_CHARTS,
@@ -55,19 +46,19 @@ import {
5546
visitDashboard,
5647
} from './shared_dashboard_functions';
5748

58-
function selectFilter(index: number) {
59-
cy.get("[data-test='filter-title-container'] [draggable='true']")
60-
.eq(index)
61-
.click();
62-
}
49+
// function selectFilter(index: number) {
50+
// cy.get("[data-test='filter-title-container'] [draggable='true']")
51+
// .eq(index)
52+
// .click();
53+
// }
6354

64-
function closeFilterModal() {
65-
cy.get('body').then($body => {
66-
if ($body.find('[data-test="native-filter-modal-cancel-button"]').length) {
67-
cy.getBySel('native-filter-modal-cancel-button').click();
68-
}
69-
});
70-
}
55+
// function closeFilterModal() {
56+
// cy.get('body').then($body => {
57+
// if ($body.find('[data-test="native-filter-modal-cancel-button"]').length) {
58+
// cy.getBySel('native-filter-modal-cancel-button').click();
59+
// }
60+
// });
61+
// }
7162

7263
describe('Native filters', () => {
7364
describe('Nativefilters initial state not required', () => {

superset-frontend/cypress-base/cypress/e2e/dashboard/nativeFilters.test.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,37 +16,29 @@
1616
* specific language governing permissions and limitations
1717
* under the License.
1818
*/
19-
import qs from 'querystring';
2019
import {
21-
dashboardView,
2220
nativeFilters,
2321
exploreView,
2422
dataTestChartName,
2523
} from 'cypress/support/directories';
2624

2725
import {
28-
addCountryNameFilter,
2926
addParentFilterWithValue,
30-
applyAdvancedTimeRangeFilterOnDashboard,
3127
applyNativeFilterValueWithIndex,
3228
cancelNativeFilterSettings,
3329
checkNativeFilterTooltip,
3430
clickOnAddFilterInModal,
3531
collapseFilterOnLeftPanel,
36-
deleteNativeFilter,
3732
enterNativeFilterEditModal,
3833
expandFilterOnLeftPanel,
39-
fillNativeFilterForm,
4034
getNativeFilterPlaceholderWithIndex,
4135
inputNativeFilterDefaultValue,
4236
saveNativeFilterSettings,
4337
nativeFilterTooltips,
44-
undoDeleteNativeFilter,
4538
validateFilterContentOnDashboard,
4639
valueNativeFilterOptions,
4740
validateFilterNameOnDashboard,
4841
testItems,
49-
WORLD_HEALTH_CHARTS,
5042
} from './utils';
5143
import {
5244
prepareDashboardFilters,

superset-frontend/cypress-base/cypress/support/e2e.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
*/
1919
import '@cypress/code-coverage/support';
2020
import '@applitools/eyes-cypress/commands';
21-
import failOnConsoleError from 'cypress-fail-on-console-error';
2221
import { expect } from 'chai';
2322
import rison from 'rison';
2423

superset-frontend/cypress-base/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"allowJs": true,
1111
"noEmit": true
1212
},
13-
"files": ["cypress/support/index.d.ts", "./node_modules/@applitools/eyes-cypress/eyes-index.d.ts"],
13+
"files": ["cypress/support/index.d.ts", "./node_modules/@applitools/eyes-cypress/types/index.d.ts"],
1414
"include": ["cypress/**/*.ts", "./cypress.config.ts"],
1515
"exclude": ["node_modules"]
1616
}

superset-frontend/jest.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ module.exports = {
3737
setupFilesAfterEnv: ['<rootDir>/spec/helpers/setup.ts'],
3838
snapshotSerializers: ['@emotion/jest/serializer'],
3939
testEnvironmentOptions: {
40+
globalsCleanup: true,
4041
url: 'http://localhost',
4142
},
4243
collectCoverageFrom: [

0 commit comments

Comments
 (0)