Skip to content

Commit

Permalink
Merge pull request #5544 from wordpress-mobile/fix/jest-29
Browse files Browse the repository at this point in the history
Update to Jest 29
  • Loading branch information
Gerardo Pacheco authored Mar 9, 2023
2 parents 1bfd820 + 2952181 commit 1e5e634
Show file tree
Hide file tree
Showing 5 changed files with 9,107 additions and 7,404 deletions.
2 changes: 1 addition & 1 deletion gutenberg
Submodule gutenberg updated 86 files
+425 −4 changelog.txt
+14 −27 docs/contributors/code/e2e/README.md
+6 −0 docs/manifest.json
+1 −1 docs/reference-guides/core-blocks.md
+57 −0 docs/reference-guides/theme-json-reference/styles-versions.md
+20 −0 docs/reference-guides/theme-json-reference/theme-json-living.md
+3 −0 docs/toc.json
+1 −1 gutenberg.php
+4 −0 lib/block-supports/layout.php
+1 −1 lib/class-wp-theme-json-gutenberg.php
+0 −28 lib/compat/wordpress-6.1/block-template-utils.php
+143 −0 lib/compat/wordpress-6.2/block-template-utils.php
+2,730 −5,989 package-lock.json
+7 −7 package.json
+1 −1 packages/README.md
+2 −1 packages/block-editor/src/components/block-settings-menu-controls/index.js
+48 −38 packages/block-editor/src/components/convert-to-group-buttons/use-convert-to-group-button-props.js
+1 −1 packages/block-editor/src/components/global-styles/test/use-global-styles-output.js
+1 −1 packages/block-editor/src/components/global-styles/use-global-styles-output.js
+7 −4 packages/block-editor/src/hooks/layout.js
+23 −17 packages/block-editor/src/layouts/constrained.js
+1 −1 packages/block-library/src/buttons/edit.native.js
+6 −1 packages/block-library/src/cover/block.json
+2 −0 packages/block-library/src/cover/index.js
+20 −0 packages/block-library/src/cover/variations.js
+16 −12 packages/block-library/src/embed/edit.js
+28 −18 packages/block-library/src/embed/edit.native.js
+12 −0 packages/block-library/src/embed/test/index.js
+29 −8 packages/block-library/src/embed/util.js
+11 −18 packages/block-library/src/navigation/edit/index.js
+0 −4 packages/block-library/src/navigation/edit/menu-inspector-controls.js
+1 −0 packages/block-library/src/post-featured-image/style.scss
+1 −0 packages/components/CHANGELOG.md
+1 −1 packages/components/src/mobile/bottom-sheet/bottom-sheet-navigation/test/navigation-container.native.js
+1 −1 packages/components/src/mobile/link-settings/test/link-settings-navigation.native.js
+2 −1 packages/components/src/resizable-box/resize-tooltip/styles/resize-tooltip.styles.ts
+1 −1 packages/core-data/README.md
+1 −1 packages/data/src/test/privateAPIs.js
+1 −8 packages/data/src/test/registry.js
+4 −0 packages/e2e-test-utils/CHANGELOG.md
+1 −1 packages/e2e-test-utils/package.json
+4 −0 packages/e2e-tests/CHANGELOG.md
+7 −0 packages/e2e-tests/babel.config.js
+3 −3 packages/e2e-tests/package.json
+1 −1 packages/e2e-tests/specs/editor/various/__snapshots__/inserting-blocks.test.js.snap
+4 −2 packages/e2e-tests/specs/site-editor/settings-sidebar.test.js
+5 −0 packages/edit-post/src/components/header/header-toolbar/index.native.js
+6 −8 packages/edit-post/src/components/layout/index.js
+1 −1 packages/edit-post/src/components/sidebar/post-template/create-modal.js
+1 −1 packages/edit-post/src/test/editor.native.js
+1 −1 packages/edit-site/src/components/add-new-template/new-template.js
+3 −2 packages/edit-site/src/components/layout/index.js
+1 −0 packages/edit-site/src/components/list/table.js
+3 −40 packages/edit-site/src/components/sidebar-navigation-screen-navigation-menus/index.js
+4 −0 packages/edit-site/src/components/sidebar-navigation-screen-navigation-menus/style.scss
+1 −1 packages/edit-site/src/components/site-hub/style.scss
+10 −17 packages/edit-site/src/components/template-part-converter/convert-to-regular.js
+9 −16 packages/edit-site/src/components/template-part-converter/convert-to-template-part.js
+28 −12 packages/edit-site/src/components/template-part-converter/index.js
+2 −4 packages/editor/src/components/autosave-monitor/test/index.js
+1 −1 packages/format-library/src/link/test/index.native.js
+4 −0 packages/jest-console/CHANGELOG.md
+2 −2 packages/jest-console/package.json
+4 −0 packages/jest-preset-default/CHANGELOG.md
+3 −4 packages/jest-preset-default/README.md
+0 −1 packages/jest-preset-default/jest-preset.js
+2 −2 packages/jest-preset-default/package.json
+4 −0 packages/jest-puppeteer-axe/CHANGELOG.md
+1 −1 packages/jest-puppeteer-axe/package.json
+14 −0 packages/react-native-editor/__device-tests__/helpers/utils.js
+62 −1 packages/react-native-editor/__device-tests__/pages/editor-page.js
+0 −1 packages/react-native-editor/jest_ui.config.js
+1 −1 packages/react-native-editor/jest_ui_test_environment.js
+1 −1 packages/report-flaky-tests/package.json
+4 −0 packages/scripts/CHANGELOG.md
+2 −6 packages/scripts/config/jest-environment-puppeteer/index.js
+4 −3 packages/scripts/package.json
+1 −1 packages/url/src/test/fixtures/wpt-data.json
+3 −3 phpunit/block-supports/layout-test.php
+1 −1 phpunit/class-wp-theme-json-test.php
+42 −1 schemas/json/theme.json
+2 −0 test/native/babel.config.js
+1 −1 test/native/integration-test-helpers/with-fake-timers.js
+17 −15 test/native/jest.config.js
+4 −1 test/unit/jest.config.js
+35 −0 test/unit/scripts/resolver.js
8 changes: 6 additions & 2 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module.exports = {
// Automatically clear mock calls and instances between every test
clearMocks: true,
preset: './gutenberg/node_modules/react-native/jest-preset.js',
setupFiles: [ '<rootDir>/' + configPath + '/setup.js' ],
setupFiles: [ '<rootDir>/' + configPath + '/setup.js', './jest.setup.js' ],
setupFilesAfterEnv: [ '<rootDir>/' + configPath + '/setup-after-env.js' ],
testMatch: [ '<rootDir>/src/**/test/*.[jt]s?(x)' ],
testPathIgnorePatterns: [
Expand All @@ -34,7 +34,9 @@ module.exports = {
'<rootDir>/jetpack/',
'/__device-tests__/',
],
testURL: 'http://localhost/',
testEnvironmentOptions: {
url: 'http://localhost/',
},
// Add the `Libraries/Utilities` subfolder to the module directories, otherwise haste/jest doesn't find Platform.js on Travis,
// and add it first so https://github.com/facebook/react-native/blob/v0.60.0/Libraries/react-native/react-native-implementation.js#L324-L326 doesn't pick up the Platform npm module.
moduleDirectories: [
Expand All @@ -51,6 +53,8 @@ module.exports = {
'|'
) })$` ]: '<rootDir>/gutenberg/packages/$1/src',
'test/helpers$': '<rootDir>/' + configPath + '/helpers.js',
jetpackConfig:
'<rootDir>/jetpack/tools/js-tools/jest/jest-jetpack-config.js',
},
haste: {
defaultPlatform: rnPlatform,
Expand Down
25 changes: 25 additions & 0 deletions jest.setup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Jetpack mocks

// Copied from https://github.com/Automattic/jetpack/blob/trunk/projects/js-packages/connection/jest.setup.js
global.window.JP_CONNECTION_INITIAL_STATE = {
userConnectionData: {
currentUser: {
wpcomUser: {
Id: 99999,
login: 'bobsacramento',
display_name: 'Bob Sacrmaneto',
},
},
},
};

jest.mock(
'./jetpack/projects/js-packages/shared-extension-utils/index.js',
() => ( {
__esModule: true,
...jest.requireActual(
'./jetpack/projects/js-packages/shared-extension-utils/index.js'
),
getHostAppNamespace: jest.fn(),
} )
);
Loading

0 comments on commit 1e5e634

Please sign in to comment.