Skip to content

Commit

Permalink
Update Jest to v29 and user-event to v14 (#1001)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattrunyon authored Jan 11, 2023
1 parent 81eceea commit c5425e9
Show file tree
Hide file tree
Showing 43 changed files with 4,655 additions and 5,932 deletions.
3 changes: 2 additions & 1 deletion jest.config.base.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const path = require('path');

module.exports = {
transform: {
'.(ts|tsx|js|jsx)': 'babel-jest',
'.(ts|tsx|js|jsx)': ['babel-jest', { rootMode: 'upward' }],
},
// Makes jest transform monaco, but continue ignoring other node_modules. Used for MonacoUtils test
transformIgnorePatterns: ['node_modules/(?!(monaco-editor)/)'],
Expand All @@ -25,5 +25,6 @@ module.exports = {
),
'^@deephaven/(.*)$': path.join(__dirname, './packages/$1/src'),
},
testEnvironment: 'jsdom',
setupFilesAfterEnv: [path.join(__dirname, './jest.setup.ts')],
};
2 changes: 2 additions & 0 deletions jest.config.lint.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module.exports = {
runner: 'jest-runner-eslint',
testMatch: ['<rootDir>/packages/*/src/**/*.{js,jsx,ts,tsx}'],
testPathIgnorePatterns: ['<rootDir>/packages/golden-layout/*'],
testEnvironment: 'node',
},
{
displayName: 'stylelint',
Expand All @@ -16,6 +17,7 @@ module.exports = {
],
testPathIgnorePatterns: ['<rootDir>/packages/golden-layout/*'],
moduleFileExtensions: ['scss'],
testEnvironment: 'node',
},
],
};
3 changes: 1 addition & 2 deletions jest.setup.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'regenerator-runtime/runtime';
import '@testing-library/jest-dom';
import 'jest-canvas-mock';
import './__mocks__/dh-core';
Expand All @@ -12,7 +11,7 @@ Log.setLogLevel(logLevel);

// disable annoying dnd-react warnings
// eslint-disable-next-line @typescript-eslint/no-explicit-any
window['__react-beautiful-dnd-disable-dev-warnings' as any] = true;
window['__react-beautiful-dnd-disable-dev-warnings'] = true;

// Define the matchMedia property so we can mock out monaco properly
// https://jestjs.io/docs/manual-mocks#mocking-methods-which-are-not-implemented-in-jsdom
Expand Down
Loading

0 comments on commit c5425e9

Please sign in to comment.