From 5d7702d391b3e690b6ad332d7122341674b60992 Mon Sep 17 00:00:00 2001 From: Aleksei Potsetsuev Date: Tue, 6 Aug 2024 18:45:59 +0800 Subject: [PATCH] chore: enable jest globals --- .../core-authentication/src/AuthSettingsService.test.ts | 1 - webapp/packages/core-blocks/src/ErrorMessage.test.tsx | 1 - webapp/packages/core-blocks/src/Icon.test.tsx | 1 - .../core-browser-settings/src/BrowserSettingsService.test.ts | 1 - webapp/packages/core-cli/configs/jest.config.js | 5 ++--- .../packages/core-events/src/EventsSettingsService.test.ts | 1 - .../core-navigation-tree/src/NavTreeSettingsService.test.ts | 1 - .../src/SettingsLocalizationService.test.ts | 1 - .../core-settings/src/createSettingsAliasResolver.test.ts | 1 - .../packages/core-theming/src/ThemeSettingsService.test.ts | 1 - .../src/DataGridSettingsService.test.ts | 1 - .../plugin-data-viewer/src/DataViewerSettingsService.test.ts | 1 - .../src/LogViewer/LogViewerSettingsService.test.ts | 1 - .../src/NodesManager/NavNodeView/NavNodeViewService.test.ts | 1 - .../src/ResourceManagerSettingsService.test.ts | 1 - .../plugin-sql-editor/src/SqlEditorSettingsService.test.ts | 1 - 16 files changed, 2 insertions(+), 18 deletions(-) diff --git a/webapp/packages/core-authentication/src/AuthSettingsService.test.ts b/webapp/packages/core-authentication/src/AuthSettingsService.test.ts index af7a04b618..bb516adcc0 100644 --- a/webapp/packages/core-authentication/src/AuthSettingsService.test.ts +++ b/webapp/packages/core-authentication/src/AuthSettingsService.test.ts @@ -6,7 +6,6 @@ * you may not use this file except in compliance with the License. */ import { expect, test } from '@jest/globals'; -import '@testing-library/jest-dom'; import { coreClientActivityManifest } from '@cloudbeaver/core-client-activity'; import { coreLocalizationManifest } from '@cloudbeaver/core-localization'; diff --git a/webapp/packages/core-blocks/src/ErrorMessage.test.tsx b/webapp/packages/core-blocks/src/ErrorMessage.test.tsx index f7b9861a7f..df3bd80a22 100644 --- a/webapp/packages/core-blocks/src/ErrorMessage.test.tsx +++ b/webapp/packages/core-blocks/src/ErrorMessage.test.tsx @@ -6,7 +6,6 @@ * you may not use this file except in compliance with the License. */ import { expect, test } from '@jest/globals'; -import '@testing-library/jest-dom'; import { screen, waitFor } from '@testing-library/react'; import { coreEventsManifest } from '@cloudbeaver/core-events'; diff --git a/webapp/packages/core-blocks/src/Icon.test.tsx b/webapp/packages/core-blocks/src/Icon.test.tsx index 06d2a8d917..19739703c3 100644 --- a/webapp/packages/core-blocks/src/Icon.test.tsx +++ b/webapp/packages/core-blocks/src/Icon.test.tsx @@ -6,7 +6,6 @@ * you may not use this file except in compliance with the License. */ import { expect, test } from '@jest/globals'; -import '@testing-library/jest-dom'; import { render, screen } from '@testing-library/react'; import { Icon } from './Icon'; diff --git a/webapp/packages/core-browser-settings/src/BrowserSettingsService.test.ts b/webapp/packages/core-browser-settings/src/BrowserSettingsService.test.ts index 1bc53bc099..5f305360b2 100644 --- a/webapp/packages/core-browser-settings/src/BrowserSettingsService.test.ts +++ b/webapp/packages/core-browser-settings/src/BrowserSettingsService.test.ts @@ -6,7 +6,6 @@ * you may not use this file except in compliance with the License. */ import { expect, test } from '@jest/globals'; -import '@testing-library/jest-dom'; import { coreBrowserManifest } from '@cloudbeaver/core-browser'; import { coreClientActivityManifest } from '@cloudbeaver/core-client-activity'; diff --git a/webapp/packages/core-cli/configs/jest.config.js b/webapp/packages/core-cli/configs/jest.config.js index 93a092e80d..3eae64c632 100644 --- a/webapp/packages/core-cli/configs/jest.config.js +++ b/webapp/packages/core-cli/configs/jest.config.js @@ -27,7 +27,7 @@ module.exports = { }, // passWithNoTests: true, setupFiles: [require.resolve('fake-indexeddb/auto'), require.resolve('../tests/setup.js')], - setupFilesAfterEnv: ['@testing-library/jest-dom'], + setupFilesAfterEnv: ['@testing-library/jest-dom/jest-globals'], transform: { '\\.jsx?$': [require.resolve('@swc/jest')], }, @@ -36,6 +36,5 @@ module.exports = { // https://mswjs.io/docs/migrations/1.x-to-2.x#cannot-find-module-mswnode-jsdom customExportConditions: [''], }, - // unset all global variables - globals: {}, + injectGlobals: false, }; diff --git a/webapp/packages/core-events/src/EventsSettingsService.test.ts b/webapp/packages/core-events/src/EventsSettingsService.test.ts index 1d1baad4c7..8adfa50342 100644 --- a/webapp/packages/core-events/src/EventsSettingsService.test.ts +++ b/webapp/packages/core-events/src/EventsSettingsService.test.ts @@ -6,7 +6,6 @@ * you may not use this file except in compliance with the License. */ import { expect, test } from '@jest/globals'; -import '@testing-library/jest-dom'; import { coreClientActivityManifest } from '@cloudbeaver/core-client-activity'; import { coreLocalizationManifest } from '@cloudbeaver/core-localization'; diff --git a/webapp/packages/core-navigation-tree/src/NavTreeSettingsService.test.ts b/webapp/packages/core-navigation-tree/src/NavTreeSettingsService.test.ts index 357452fb3f..c1043a6213 100644 --- a/webapp/packages/core-navigation-tree/src/NavTreeSettingsService.test.ts +++ b/webapp/packages/core-navigation-tree/src/NavTreeSettingsService.test.ts @@ -6,7 +6,6 @@ * you may not use this file except in compliance with the License. */ import { expect, test } from '@jest/globals'; -import '@testing-library/jest-dom'; import { coreAuthenticationManifest } from '@cloudbeaver/core-authentication'; import { mockAuthentication } from '@cloudbeaver/core-authentication/dist/__custom_mocks__/mockAuthentication'; diff --git a/webapp/packages/core-settings-localization/src/SettingsLocalizationService.test.ts b/webapp/packages/core-settings-localization/src/SettingsLocalizationService.test.ts index 5b88a48586..6ff92548d8 100644 --- a/webapp/packages/core-settings-localization/src/SettingsLocalizationService.test.ts +++ b/webapp/packages/core-settings-localization/src/SettingsLocalizationService.test.ts @@ -6,7 +6,6 @@ * you may not use this file except in compliance with the License. */ import { expect, test } from '@jest/globals'; -import '@testing-library/jest-dom'; import { coreClientActivityManifest } from '@cloudbeaver/core-client-activity'; import { coreLocalizationManifest } from '@cloudbeaver/core-localization'; diff --git a/webapp/packages/core-settings/src/createSettingsAliasResolver.test.ts b/webapp/packages/core-settings/src/createSettingsAliasResolver.test.ts index 6d17c6417b..c5cc4d109a 100644 --- a/webapp/packages/core-settings/src/createSettingsAliasResolver.test.ts +++ b/webapp/packages/core-settings/src/createSettingsAliasResolver.test.ts @@ -6,7 +6,6 @@ * you may not use this file except in compliance with the License. */ import { expect, test } from '@jest/globals'; -import '@testing-library/jest-dom'; import { SyncExecutor } from '@cloudbeaver/core-executor'; diff --git a/webapp/packages/core-theming/src/ThemeSettingsService.test.ts b/webapp/packages/core-theming/src/ThemeSettingsService.test.ts index 99eba7bf87..b5ff5e2de5 100644 --- a/webapp/packages/core-theming/src/ThemeSettingsService.test.ts +++ b/webapp/packages/core-theming/src/ThemeSettingsService.test.ts @@ -6,7 +6,6 @@ * you may not use this file except in compliance with the License. */ import { expect, test } from '@jest/globals'; -import '@testing-library/jest-dom'; import { coreClientActivityManifest } from '@cloudbeaver/core-client-activity'; import { coreEventsManifest } from '@cloudbeaver/core-events'; diff --git a/webapp/packages/plugin-data-spreadsheet-new/src/DataGridSettingsService.test.ts b/webapp/packages/plugin-data-spreadsheet-new/src/DataGridSettingsService.test.ts index 18314b300e..7906a90768 100644 --- a/webapp/packages/plugin-data-spreadsheet-new/src/DataGridSettingsService.test.ts +++ b/webapp/packages/plugin-data-spreadsheet-new/src/DataGridSettingsService.test.ts @@ -6,7 +6,6 @@ * you may not use this file except in compliance with the License. */ import { expect, test } from '@jest/globals'; -import '@testing-library/jest-dom'; import { coreAdministrationManifest } from '@cloudbeaver/core-administration'; import { coreAppManifest } from '@cloudbeaver/core-app'; diff --git a/webapp/packages/plugin-data-viewer/src/DataViewerSettingsService.test.ts b/webapp/packages/plugin-data-viewer/src/DataViewerSettingsService.test.ts index d2b7e18db9..27531197f1 100644 --- a/webapp/packages/plugin-data-viewer/src/DataViewerSettingsService.test.ts +++ b/webapp/packages/plugin-data-viewer/src/DataViewerSettingsService.test.ts @@ -6,7 +6,6 @@ * you may not use this file except in compliance with the License. */ import { beforeAll, describe, expect, test } from '@jest/globals'; -import '@testing-library/jest-dom'; import { coreAdministrationManifest } from '@cloudbeaver/core-administration'; import { coreAppManifest } from '@cloudbeaver/core-app'; diff --git a/webapp/packages/plugin-log-viewer/src/LogViewer/LogViewerSettingsService.test.ts b/webapp/packages/plugin-log-viewer/src/LogViewer/LogViewerSettingsService.test.ts index 14d304607e..8864b159a9 100644 --- a/webapp/packages/plugin-log-viewer/src/LogViewer/LogViewerSettingsService.test.ts +++ b/webapp/packages/plugin-log-viewer/src/LogViewer/LogViewerSettingsService.test.ts @@ -6,7 +6,6 @@ * you may not use this file except in compliance with the License. */ import { expect, test } from '@jest/globals'; -import '@testing-library/jest-dom'; import { coreAppManifest } from '@cloudbeaver/core-app'; import { coreAuthenticationManifest } from '@cloudbeaver/core-authentication'; diff --git a/webapp/packages/plugin-navigation-tree/src/NodesManager/NavNodeView/NavNodeViewService.test.ts b/webapp/packages/plugin-navigation-tree/src/NodesManager/NavNodeView/NavNodeViewService.test.ts index 308cb4754a..69af912a51 100644 --- a/webapp/packages/plugin-navigation-tree/src/NodesManager/NavNodeView/NavNodeViewService.test.ts +++ b/webapp/packages/plugin-navigation-tree/src/NodesManager/NavNodeView/NavNodeViewService.test.ts @@ -6,7 +6,6 @@ * you may not use this file except in compliance with the License. */ import { describe, expect, test } from '@jest/globals'; -import '@testing-library/jest-dom'; import { coreAdministrationManifest } from '@cloudbeaver/core-administration'; import { coreAppManifest } from '@cloudbeaver/core-app'; diff --git a/webapp/packages/plugin-resource-manager/src/ResourceManagerSettingsService.test.ts b/webapp/packages/plugin-resource-manager/src/ResourceManagerSettingsService.test.ts index 72bc177359..5007c8cbbd 100644 --- a/webapp/packages/plugin-resource-manager/src/ResourceManagerSettingsService.test.ts +++ b/webapp/packages/plugin-resource-manager/src/ResourceManagerSettingsService.test.ts @@ -6,7 +6,6 @@ * you may not use this file except in compliance with the License. */ import { expect, test } from '@jest/globals'; -import '@testing-library/jest-dom'; import { coreClientActivityManifest } from '@cloudbeaver/core-client-activity'; import { coreLocalizationManifest } from '@cloudbeaver/core-localization'; diff --git a/webapp/packages/plugin-sql-editor/src/SqlEditorSettingsService.test.ts b/webapp/packages/plugin-sql-editor/src/SqlEditorSettingsService.test.ts index 646ea91007..c6eabf1923 100644 --- a/webapp/packages/plugin-sql-editor/src/SqlEditorSettingsService.test.ts +++ b/webapp/packages/plugin-sql-editor/src/SqlEditorSettingsService.test.ts @@ -6,7 +6,6 @@ * you may not use this file except in compliance with the License. */ import { expect, test } from '@jest/globals'; -import '@testing-library/jest-dom'; import { coreAdministrationManifest } from '@cloudbeaver/core-administration'; import { coreAppManifest } from '@cloudbeaver/core-app';