From 2dbda40969bc04a3c0df20f7dc9e7d39474da17d Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 9 Nov 2024 13:43:30 -0600 Subject: [PATCH] Import vitest functions explicitly, remove "vitest/globals" from tsconfig --- src/actions/about.test.ts | 2 ++ src/actions/account-notes.test.ts | 2 ++ src/actions/accounts.test.ts | 2 ++ src/actions/blocks.test.ts | 2 ++ src/actions/compose.test.ts | 2 ++ src/actions/notifications.test.ts | 2 ++ src/actions/onboarding.test.ts | 2 ++ src/actions/preload.test.ts | 2 ++ src/actions/status-quotes.test.ts | 2 ++ src/actions/statuses.test.ts | 2 ++ src/api/hooks/groups/useGroup.test.ts | 2 ++ src/api/hooks/groups/useGroupLookup.test.ts | 2 ++ src/api/hooks/groups/useGroupMedia.test.ts | 2 ++ src/api/hooks/groups/useGroupMembers.test.ts | 2 ++ src/api/hooks/groups/useGroups.test.ts | 2 ++ src/api/hooks/groups/usePendingGroups.test.ts | 2 ++ src/components/account.test.tsx | 2 ++ src/components/autosuggest-emoji.test.tsx | 2 ++ src/components/badge.test.tsx | 2 ++ src/components/display-name.test.tsx | 2 ++ src/components/polls/poll-footer.test.tsx | 2 ++ src/components/quoted-status.test.tsx | 2 ++ src/components/scroll-top-button.test.tsx | 2 ++ src/components/status.test.tsx | 2 ++ src/components/statuses/sensitive-content-overlay.test.tsx | 2 ++ src/components/ui/avatar/avatar.test.tsx | 2 ++ src/components/ui/button/button.test.tsx | 2 ++ src/components/ui/card/card.test.tsx | 2 ++ src/components/ui/column/column.test.tsx | 2 ++ src/components/ui/datepicker/datepicker.test.tsx | 2 ++ src/components/ui/divider/divider.test.tsx | 2 ++ src/components/ui/emoji/emoji.test.tsx | 2 ++ src/components/ui/form-actions/form-actions.test.tsx | 2 ++ src/components/ui/form-group/form-group.test.tsx | 2 ++ src/components/ui/form/form.test.tsx | 2 ++ src/components/ui/icon/svg-icon.test.tsx | 2 ++ src/components/ui/modal/modal.test.tsx | 2 ++ src/components/validation-checkmark.test.tsx | 2 ++ src/entity-store/reducer.test.ts | 2 ++ src/features/auth-login/components/captcha.test.tsx | 2 ++ src/features/auth-login/components/login-form.test.tsx | 2 ++ src/features/auth-login/components/login-page.test.tsx | 2 ++ src/features/auth-login/components/otp-auth-form.test.tsx | 2 ++ .../auth-login/components/password-reset-confirm.test.tsx | 2 ++ src/features/chats/components/chat-list-item.test.tsx | 2 ++ src/features/chats/components/chat-message-list.test.tsx | 2 ++ .../chats/components/chat-message-reaction.test.tsx | 2 ++ src/features/chats/components/chat-pane-header.test.tsx | 2 ++ src/features/chats/components/chat-pane/chat-pane.test.tsx | 2 ++ .../chats/components/chat-search/chat-search.test.tsx | 2 ++ src/features/chats/components/chat-widget.test.tsx | 2 ++ .../compose/components/polls/duration-selector.test.tsx | 2 ++ src/features/emoji/index.test.ts | 2 ++ src/features/emoji/search.test.ts | 2 ++ src/features/group/components/group-action-button.test.tsx | 2 ++ src/features/group/components/group-header.test.tsx | 2 ++ src/features/group/components/group-member-count.test.tsx | 2 ++ .../group/components/group-member-list-item.test.tsx | 2 ++ src/features/group/components/group-options-button.test.tsx | 2 ++ src/features/group/components/group-privacy.test.tsx | 2 ++ src/features/group/components/group-relationship.test.tsx | 2 ++ src/features/group/components/group-tag-list-item.test.tsx | 2 ++ .../groups/components/discover/group-grid-item.test.tsx | 2 ++ .../groups/components/discover/group-list-item.test.tsx | 2 ++ .../groups/components/discover/layout-buttons.test.tsx | 2 ++ .../groups/components/discover/search/blankslate.test.tsx | 2 ++ .../groups/components/discover/search/results.test.tsx | 2 ++ .../groups/components/discover/search/search.test.tsx | 2 ++ .../groups/components/discover/tag-list-item.test.tsx | 2 ++ src/features/groups/discover.test.tsx | 2 ++ src/features/notifications/components/notification.test.tsx | 2 ++ src/features/ui/components/compose-button.test.tsx | 2 ++ src/features/ui/components/cta-banner.test.tsx | 2 ++ .../ui/components/modals/landing-page-modal.test.tsx | 2 ++ .../ui/components/modals/unauthorized-modal.test.tsx | 2 ++ src/features/ui/components/navbar.test.tsx | 2 ++ src/features/ui/components/panels/sign-up-panel.test.tsx | 2 ++ src/features/ui/components/subscribe-button.test.tsx | 2 ++ src/features/ui/components/trends-panel.test.tsx | 2 ++ src/hooks/__mocks__/resize-observer.ts | 2 ++ src/hooks/useDimensions.test.ts | 2 ++ src/jest/test-helpers.tsx | 1 + src/jest/test-setup.ts | 6 ++---- src/normalizers/account.test.ts | 2 ++ src/normalizers/attachment.test.ts | 2 ++ src/normalizers/chat-message.test.ts | 2 ++ src/normalizers/mention.test.ts | 2 ++ src/normalizers/notification.test.ts | 2 ++ src/normalizers/soapbox/soapbox-config.test.ts | 2 ++ src/normalizers/status.test.ts | 2 ++ src/queries/chats.test.ts | 2 ++ src/queries/relationships.test.ts | 2 ++ src/queries/suggestions.test.ts | 2 ++ src/queries/trends.test.ts | 2 ++ src/reducers/admin.test.ts | 2 ++ src/reducers/compose.test.ts | 2 ++ src/reducers/contexts.test.ts | 2 ++ src/reducers/conversations.test.ts | 2 ++ src/reducers/custom-emojis.test.ts | 2 ++ src/reducers/domain-lists.test.ts | 2 ++ src/reducers/dropdown-menu.test.ts | 2 ++ src/reducers/filters.test.ts | 2 ++ src/reducers/index.test.ts | 2 ++ src/reducers/instance.test.ts | 2 ++ src/reducers/list-adder.test.ts | 2 ++ src/reducers/lists.test.ts | 2 ++ src/reducers/me.test.ts | 2 ++ src/reducers/meta.test.ts | 2 ++ src/reducers/modals.test.ts | 2 ++ src/reducers/mutes.test.ts | 2 ++ src/reducers/onboarding.test.ts | 2 ++ src/reducers/polls.test.ts | 2 ++ src/reducers/relationships.test.ts | 2 ++ src/reducers/reports.test.ts | 2 ++ src/reducers/settings.test.ts | 2 ++ src/reducers/sidebar.test.ts | 2 ++ src/reducers/soapbox.test.ts | 2 ++ src/reducers/status-hover-card.test.tsx | 2 ++ src/reducers/status-lists.test.ts | 2 ++ src/reducers/statuses.test.ts | 2 ++ src/reducers/suggestions.test.ts | 2 ++ src/reducers/timelines.test.ts | 2 ++ src/reducers/trends.test.ts | 2 ++ src/reducers/user-lists.test.ts | 2 ++ src/schemas/card.test.ts | 2 ++ src/schemas/group.test.ts | 2 ++ src/schemas/instance.test.ts | 2 ++ src/schemas/poll.test.ts | 2 ++ src/toast.test.tsx | 2 ++ src/utils/badges.test.ts | 2 ++ src/utils/base64.test.ts | 2 ++ src/utils/chats.test.ts | 2 ++ src/utils/colors.test.ts | 2 ++ src/utils/comparators.test.ts | 2 ++ src/utils/config-db.test.ts | 2 ++ src/utils/emoji-reacts.test.ts | 2 ++ src/utils/emoji.test.ts | 2 ++ src/utils/features.test.ts | 2 ++ src/utils/html.test.ts | 2 ++ src/utils/input.test.ts | 2 ++ src/utils/media.test.ts | 2 ++ src/utils/numbers.test.tsx | 2 ++ src/utils/queries.test.ts | 2 ++ src/utils/status.test.ts | 2 ++ src/utils/tailwind.test.ts | 2 ++ src/utils/timelines.test.ts | 2 ++ tailwind/colors.test.ts | 2 ++ tsconfig.json | 1 - vite.config.ts | 2 +- 149 files changed, 294 insertions(+), 6 deletions(-) diff --git a/src/actions/about.test.ts b/src/actions/about.test.ts index e05a7f643..4a1afa479 100644 --- a/src/actions/about.test.ts +++ b/src/actions/about.test.ts @@ -1,4 +1,6 @@ import MockAdapter from 'axios-mock-adapter'; +import { describe, expect, it } from 'vitest'; + import { staticClient } from 'soapbox/api'; import { mockStore } from 'soapbox/jest/test-helpers'; diff --git a/src/actions/account-notes.test.ts b/src/actions/account-notes.test.ts index 5cd45f26e..dbebf8076 100644 --- a/src/actions/account-notes.test.ts +++ b/src/actions/account-notes.test.ts @@ -1,3 +1,5 @@ +import { beforeEach, describe, expect, it } from 'vitest'; + import { __stub } from 'soapbox/api'; import { mockStore, rootState } from 'soapbox/jest/test-helpers'; diff --git a/src/actions/accounts.test.ts b/src/actions/accounts.test.ts index 34da76b33..422a0217b 100644 --- a/src/actions/accounts.test.ts +++ b/src/actions/accounts.test.ts @@ -1,4 +1,6 @@ import { Map as ImmutableMap } from 'immutable'; +import { beforeEach, describe, expect, it } from 'vitest'; + import { __stub } from 'soapbox/api'; import { buildInstance, buildRelationship } from 'soapbox/jest/factory'; diff --git a/src/actions/blocks.test.ts b/src/actions/blocks.test.ts index bca50fe12..b7a73f9eb 100644 --- a/src/actions/blocks.test.ts +++ b/src/actions/blocks.test.ts @@ -1,3 +1,5 @@ +import { beforeEach, describe, expect, it } from 'vitest'; + import { __stub } from 'soapbox/api'; import { mockStore, rootState } from 'soapbox/jest/test-helpers'; import { ListRecord, ReducerRecord as UserListsRecord } from 'soapbox/reducers/user-lists'; diff --git a/src/actions/compose.test.ts b/src/actions/compose.test.ts index 01bd8b716..b1acb0b6e 100644 --- a/src/actions/compose.test.ts +++ b/src/actions/compose.test.ts @@ -1,4 +1,6 @@ import { OrderedSet as ImmutableOrderedSet } from 'immutable'; +import { beforeEach, describe, expect, it, vi } from 'vitest'; + import { buildInstance } from 'soapbox/jest/factory'; import { mockStore, rootState } from 'soapbox/jest/test-helpers'; diff --git a/src/actions/notifications.test.ts b/src/actions/notifications.test.ts index c46040216..41ed43d82 100644 --- a/src/actions/notifications.test.ts +++ b/src/actions/notifications.test.ts @@ -1,4 +1,6 @@ import { OrderedMap as ImmutableOrderedMap } from 'immutable'; +import { describe, expect, it } from 'vitest'; + import { __stub } from 'soapbox/api'; import { mockStore, rootState } from 'soapbox/jest/test-helpers'; diff --git a/src/actions/onboarding.test.ts b/src/actions/onboarding.test.ts index 3f638ece9..7d2fcdb26 100644 --- a/src/actions/onboarding.test.ts +++ b/src/actions/onboarding.test.ts @@ -1,3 +1,5 @@ +import { beforeEach, describe, expect, it, vi } from 'vitest'; + import { mockStore, mockWindowProperty, rootState } from 'soapbox/jest/test-helpers'; import { checkOnboardingStatus, startOnboarding, endOnboarding } from './onboarding'; diff --git a/src/actions/preload.test.ts b/src/actions/preload.test.ts index 24a5f86b3..96cd9bbf6 100644 --- a/src/actions/preload.test.ts +++ b/src/actions/preload.test.ts @@ -1,3 +1,5 @@ +import { describe, expect, it } from 'vitest'; + import { __stub } from 'soapbox/api'; import { mockStore } from 'soapbox/jest/test-helpers'; diff --git a/src/actions/status-quotes.test.ts b/src/actions/status-quotes.test.ts index 6f53b48c6..c2d6ac1b9 100644 --- a/src/actions/status-quotes.test.ts +++ b/src/actions/status-quotes.test.ts @@ -1,4 +1,6 @@ import { Map as ImmutableMap } from 'immutable'; +import { beforeEach, describe, expect, it } from 'vitest'; + import { __stub } from 'soapbox/api'; import { mockStore, rootState } from 'soapbox/jest/test-helpers'; diff --git a/src/actions/statuses.test.ts b/src/actions/statuses.test.ts index dd4831dc7..93c5b9c08 100644 --- a/src/actions/statuses.test.ts +++ b/src/actions/statuses.test.ts @@ -1,4 +1,6 @@ import { fromJS, Map as ImmutableMap } from 'immutable'; +import { beforeEach, describe, expect, it } from 'vitest'; + import { STATUSES_IMPORT } from 'soapbox/actions/importer'; import { __stub } from 'soapbox/api'; diff --git a/src/api/hooks/groups/useGroup.test.ts b/src/api/hooks/groups/useGroup.test.ts index c6df44aab..4b9c91f56 100644 --- a/src/api/hooks/groups/useGroup.test.ts +++ b/src/api/hooks/groups/useGroup.test.ts @@ -1,3 +1,5 @@ +import { beforeEach, describe, expect, it } from 'vitest'; + import { __stub } from 'soapbox/api'; import { buildGroup } from 'soapbox/jest/factory'; import { renderHook, waitFor } from 'soapbox/jest/test-helpers'; diff --git a/src/api/hooks/groups/useGroupLookup.test.ts b/src/api/hooks/groups/useGroupLookup.test.ts index 6b659f605..4c7bcbe1f 100644 --- a/src/api/hooks/groups/useGroupLookup.test.ts +++ b/src/api/hooks/groups/useGroupLookup.test.ts @@ -1,3 +1,5 @@ +import { beforeEach, describe, expect, it } from 'vitest'; + import { __stub } from 'soapbox/api'; import { buildGroup } from 'soapbox/jest/factory'; import { renderHook, rootState, waitFor } from 'soapbox/jest/test-helpers'; diff --git a/src/api/hooks/groups/useGroupMedia.test.ts b/src/api/hooks/groups/useGroupMedia.test.ts index c38615c05..bbe643c4d 100644 --- a/src/api/hooks/groups/useGroupMedia.test.ts +++ b/src/api/hooks/groups/useGroupMedia.test.ts @@ -1,3 +1,5 @@ +import { beforeEach, describe, expect, it } from 'vitest'; + import { __stub } from 'soapbox/api'; import { buildStatus } from 'soapbox/jest/factory'; import { renderHook, waitFor } from 'soapbox/jest/test-helpers'; diff --git a/src/api/hooks/groups/useGroupMembers.test.ts b/src/api/hooks/groups/useGroupMembers.test.ts index d82133423..3087bd3fb 100644 --- a/src/api/hooks/groups/useGroupMembers.test.ts +++ b/src/api/hooks/groups/useGroupMembers.test.ts @@ -1,3 +1,5 @@ +import { beforeEach, describe, expect, it } from 'vitest'; + import { __stub } from 'soapbox/api'; import { buildGroupMember } from 'soapbox/jest/factory'; import { renderHook, waitFor } from 'soapbox/jest/test-helpers'; diff --git a/src/api/hooks/groups/useGroups.test.ts b/src/api/hooks/groups/useGroups.test.ts index c29d6eb09..3cbddf98a 100644 --- a/src/api/hooks/groups/useGroups.test.ts +++ b/src/api/hooks/groups/useGroups.test.ts @@ -1,3 +1,5 @@ +import { beforeEach, describe, expect, it } from 'vitest'; + import { __stub } from 'soapbox/api'; import { buildGroup } from 'soapbox/jest/factory'; import { renderHook, waitFor } from 'soapbox/jest/test-helpers'; diff --git a/src/api/hooks/groups/usePendingGroups.test.ts b/src/api/hooks/groups/usePendingGroups.test.ts index a590360c3..5c39902e9 100644 --- a/src/api/hooks/groups/usePendingGroups.test.ts +++ b/src/api/hooks/groups/usePendingGroups.test.ts @@ -1,3 +1,5 @@ +import { beforeEach, describe, expect, it } from 'vitest'; + import { __stub } from 'soapbox/api'; import { Entities } from 'soapbox/entity-store/entities'; import { buildAccount, buildGroup } from 'soapbox/jest/factory'; diff --git a/src/components/account.test.tsx b/src/components/account.test.tsx index 306ff21a8..00803029b 100644 --- a/src/components/account.test.tsx +++ b/src/components/account.test.tsx @@ -1,4 +1,6 @@ import React from 'react'; +import { describe, expect, it } from 'vitest'; + import { buildAccount } from 'soapbox/jest/factory'; import { render, screen } from 'soapbox/jest/test-helpers'; diff --git a/src/components/autosuggest-emoji.test.tsx b/src/components/autosuggest-emoji.test.tsx index 38e45a370..1bc00895b 100644 --- a/src/components/autosuggest-emoji.test.tsx +++ b/src/components/autosuggest-emoji.test.tsx @@ -1,4 +1,6 @@ import React from 'react'; +import { describe, expect, it } from 'vitest'; + import { render, screen } from 'soapbox/jest/test-helpers'; diff --git a/src/components/badge.test.tsx b/src/components/badge.test.tsx index 6204f7dcb..01ee857b5 100644 --- a/src/components/badge.test.tsx +++ b/src/components/badge.test.tsx @@ -1,4 +1,6 @@ import React from 'react'; +import { describe, expect, it } from 'vitest'; + import { render, screen } from 'soapbox/jest/test-helpers'; diff --git a/src/components/display-name.test.tsx b/src/components/display-name.test.tsx index 7c819f637..1d8742991 100644 --- a/src/components/display-name.test.tsx +++ b/src/components/display-name.test.tsx @@ -1,4 +1,6 @@ import React from 'react'; +import { describe, expect, it } from 'vitest'; + import { buildAccount } from 'soapbox/jest/factory'; import { render, screen } from 'soapbox/jest/test-helpers'; diff --git a/src/components/polls/poll-footer.test.tsx b/src/components/polls/poll-footer.test.tsx index 0215d170a..5526ed35f 100644 --- a/src/components/polls/poll-footer.test.tsx +++ b/src/components/polls/poll-footer.test.tsx @@ -1,7 +1,9 @@ + import userEvent from '@testing-library/user-event'; import React from 'react'; import { IntlProvider } from 'react-intl'; import { Provider } from 'react-redux'; +import { beforeEach, describe, expect, it } from 'vitest'; import { __stub } from 'soapbox/api'; import { mockStore, render, screen, rootState } from 'soapbox/jest/test-helpers'; diff --git a/src/components/quoted-status.test.tsx b/src/components/quoted-status.test.tsx index ffb1419b4..d9c27cb5d 100644 --- a/src/components/quoted-status.test.tsx +++ b/src/components/quoted-status.test.tsx @@ -1,4 +1,6 @@ import React from 'react'; +import { describe, expect, it } from 'vitest'; + import { render, screen, rootState } from 'soapbox/jest/test-helpers'; import { normalizeStatus, normalizeAccount } from 'soapbox/normalizers'; diff --git a/src/components/scroll-top-button.test.tsx b/src/components/scroll-top-button.test.tsx index d016ade8f..f7c100cc8 100644 --- a/src/components/scroll-top-button.test.tsx +++ b/src/components/scroll-top-button.test.tsx @@ -1,5 +1,7 @@ + import React from 'react'; import { defineMessages } from 'react-intl'; +import { describe, expect, it } from 'vitest'; import { render, screen } from 'soapbox/jest/test-helpers'; diff --git a/src/components/status.test.tsx b/src/components/status.test.tsx index a37c966cd..3a7b23367 100644 --- a/src/components/status.test.tsx +++ b/src/components/status.test.tsx @@ -1,4 +1,6 @@ import React from 'react'; +import { describe, expect, it } from 'vitest'; + import { buildAccount } from 'soapbox/jest/factory'; import { render, screen, rootState } from 'soapbox/jest/test-helpers'; diff --git a/src/components/statuses/sensitive-content-overlay.test.tsx b/src/components/statuses/sensitive-content-overlay.test.tsx index 9bace5784..a9caff8df 100644 --- a/src/components/statuses/sensitive-content-overlay.test.tsx +++ b/src/components/statuses/sensitive-content-overlay.test.tsx @@ -1,5 +1,7 @@ + import { Map as ImmutableMap } from 'immutable'; import React from 'react'; +import { beforeEach, describe, expect, it } from 'vitest'; import { fireEvent, render, rootState, screen } from 'soapbox/jest/test-helpers'; import { normalizeStatus } from 'soapbox/normalizers'; diff --git a/src/components/ui/avatar/avatar.test.tsx b/src/components/ui/avatar/avatar.test.tsx index 6c958f0cb..8cf4c7baa 100644 --- a/src/components/ui/avatar/avatar.test.tsx +++ b/src/components/ui/avatar/avatar.test.tsx @@ -1,4 +1,6 @@ import React from 'react'; +import { describe, expect, it } from 'vitest'; + import { render, screen } from 'soapbox/jest/test-helpers'; diff --git a/src/components/ui/button/button.test.tsx b/src/components/ui/button/button.test.tsx index 4124958d7..bec0b2801 100644 --- a/src/components/ui/button/button.test.tsx +++ b/src/components/ui/button/button.test.tsx @@ -1,4 +1,6 @@ import React from 'react'; +import { describe, expect, it, vi } from 'vitest'; + import { fireEvent, render, screen } from 'soapbox/jest/test-helpers'; diff --git a/src/components/ui/card/card.test.tsx b/src/components/ui/card/card.test.tsx index 1971441ae..cebaffc15 100644 --- a/src/components/ui/card/card.test.tsx +++ b/src/components/ui/card/card.test.tsx @@ -1,4 +1,6 @@ import React from 'react'; +import { describe, expect, it } from 'vitest'; + import { render, screen } from 'soapbox/jest/test-helpers'; diff --git a/src/components/ui/column/column.test.tsx b/src/components/ui/column/column.test.tsx index bc40ca59d..c63ec8aad 100644 --- a/src/components/ui/column/column.test.tsx +++ b/src/components/ui/column/column.test.tsx @@ -1,4 +1,6 @@ import React from 'react'; +import { describe, expect, it } from 'vitest'; + import { render, screen } from 'soapbox/jest/test-helpers'; diff --git a/src/components/ui/datepicker/datepicker.test.tsx b/src/components/ui/datepicker/datepicker.test.tsx index bf856c236..c75e6eb9f 100644 --- a/src/components/ui/datepicker/datepicker.test.tsx +++ b/src/components/ui/datepicker/datepicker.test.tsx @@ -1,5 +1,7 @@ + import userEvent from '@testing-library/user-event'; import React from 'react'; +import { describe, expect, it, vi } from 'vitest'; import { queryAllByRole, render, screen } from 'soapbox/jest/test-helpers'; diff --git a/src/components/ui/divider/divider.test.tsx b/src/components/ui/divider/divider.test.tsx index 43a53eec8..cb7c8eb82 100644 --- a/src/components/ui/divider/divider.test.tsx +++ b/src/components/ui/divider/divider.test.tsx @@ -1,4 +1,6 @@ import React from 'react'; +import { describe, expect, it } from 'vitest'; + import { render, screen } from 'soapbox/jest/test-helpers'; diff --git a/src/components/ui/emoji/emoji.test.tsx b/src/components/ui/emoji/emoji.test.tsx index c4bf686d8..bc3fc468f 100644 --- a/src/components/ui/emoji/emoji.test.tsx +++ b/src/components/ui/emoji/emoji.test.tsx @@ -1,4 +1,6 @@ import React from 'react'; +import { describe, expect, it } from 'vitest'; + import { render, screen } from 'soapbox/jest/test-helpers'; diff --git a/src/components/ui/form-actions/form-actions.test.tsx b/src/components/ui/form-actions/form-actions.test.tsx index 32ff56638..4a6e8be90 100644 --- a/src/components/ui/form-actions/form-actions.test.tsx +++ b/src/components/ui/form-actions/form-actions.test.tsx @@ -1,4 +1,6 @@ import React from 'react'; +import { describe, expect, it } from 'vitest'; + import { render, screen } from 'soapbox/jest/test-helpers'; diff --git a/src/components/ui/form-group/form-group.test.tsx b/src/components/ui/form-group/form-group.test.tsx index 2b79c9c75..54fa80cf0 100644 --- a/src/components/ui/form-group/form-group.test.tsx +++ b/src/components/ui/form-group/form-group.test.tsx @@ -1,4 +1,6 @@ import React from 'react'; +import { describe, expect, it } from 'vitest'; + import { render, screen } from 'soapbox/jest/test-helpers'; diff --git a/src/components/ui/form/form.test.tsx b/src/components/ui/form/form.test.tsx index c25d590ed..ee581aa83 100644 --- a/src/components/ui/form/form.test.tsx +++ b/src/components/ui/form/form.test.tsx @@ -1,4 +1,6 @@ import React from 'react'; +import { describe, expect, it, vi } from 'vitest'; + import { fireEvent, render, screen } from 'soapbox/jest/test-helpers'; diff --git a/src/components/ui/icon/svg-icon.test.tsx b/src/components/ui/icon/svg-icon.test.tsx index bd8c0a81b..c238d4010 100644 --- a/src/components/ui/icon/svg-icon.test.tsx +++ b/src/components/ui/icon/svg-icon.test.tsx @@ -1,5 +1,7 @@ + import IconCode from '@tabler/icons/outline/code.svg'; import React from 'react'; +import { describe, expect, it } from 'vitest'; import { render, screen } from 'soapbox/jest/test-helpers'; diff --git a/src/components/ui/modal/modal.test.tsx b/src/components/ui/modal/modal.test.tsx index 2941fe89a..51895d8ce 100644 --- a/src/components/ui/modal/modal.test.tsx +++ b/src/components/ui/modal/modal.test.tsx @@ -1,5 +1,7 @@ + import userEvent from '@testing-library/user-event'; import React from 'react'; +import { describe, expect, it, vi } from 'vitest'; import { render, screen } from 'soapbox/jest/test-helpers'; diff --git a/src/components/validation-checkmark.test.tsx b/src/components/validation-checkmark.test.tsx index fd0d4b765..874f478d3 100644 --- a/src/components/validation-checkmark.test.tsx +++ b/src/components/validation-checkmark.test.tsx @@ -1,4 +1,6 @@ import React from 'react'; +import { describe, expect, it } from 'vitest'; + import { render, screen } from 'soapbox/jest/test-helpers'; diff --git a/src/entity-store/reducer.test.ts b/src/entity-store/reducer.test.ts index 36970463f..c5166437a 100644 --- a/src/entity-store/reducer.test.ts +++ b/src/entity-store/reducer.test.ts @@ -1,3 +1,5 @@ +import { expect, test } from 'vitest'; + import { deleteEntities, dismissEntities, diff --git a/src/features/auth-login/components/captcha.test.tsx b/src/features/auth-login/components/captcha.test.tsx index 53cb7e7ae..a9123cbae 100644 --- a/src/features/auth-login/components/captcha.test.tsx +++ b/src/features/auth-login/components/captcha.test.tsx @@ -1,5 +1,7 @@ + import { Map as ImmutableMap } from 'immutable'; import React from 'react'; +import { describe, expect, it } from 'vitest'; import { render, screen } from 'soapbox/jest/test-helpers'; diff --git a/src/features/auth-login/components/login-form.test.tsx b/src/features/auth-login/components/login-form.test.tsx index cef110b44..c4b68eae5 100644 --- a/src/features/auth-login/components/login-form.test.tsx +++ b/src/features/auth-login/components/login-form.test.tsx @@ -1,4 +1,6 @@ import React from 'react'; +import { describe, expect, it, vi } from 'vitest'; + import { fireEvent, render, screen } from 'soapbox/jest/test-helpers'; import { instanceV1Schema } from 'soapbox/schemas/instance'; diff --git a/src/features/auth-login/components/login-page.test.tsx b/src/features/auth-login/components/login-page.test.tsx index dfae49747..4fa0d2400 100644 --- a/src/features/auth-login/components/login-page.test.tsx +++ b/src/features/auth-login/components/login-page.test.tsx @@ -1,4 +1,6 @@ import React from 'react'; +import { describe, expect, it } from 'vitest'; + import { render, screen } from 'soapbox/jest/test-helpers'; import { instanceV1Schema } from 'soapbox/schemas/instance'; diff --git a/src/features/auth-login/components/otp-auth-form.test.tsx b/src/features/auth-login/components/otp-auth-form.test.tsx index 432660643..495838e06 100644 --- a/src/features/auth-login/components/otp-auth-form.test.tsx +++ b/src/features/auth-login/components/otp-auth-form.test.tsx @@ -1,4 +1,6 @@ import React from 'react'; +import { describe, expect, it } from 'vitest'; + import { render, screen } from 'soapbox/jest/test-helpers'; diff --git a/src/features/auth-login/components/password-reset-confirm.test.tsx b/src/features/auth-login/components/password-reset-confirm.test.tsx index d4c8d1196..e566eff39 100644 --- a/src/features/auth-login/components/password-reset-confirm.test.tsx +++ b/src/features/auth-login/components/password-reset-confirm.test.tsx @@ -1,5 +1,7 @@ + import React from 'react'; import { Route, Switch } from 'react-router-dom'; +import { describe, expect, it } from 'vitest'; import { __stub } from 'soapbox/api'; import { fireEvent, render, screen, waitFor } from 'soapbox/jest/test-helpers'; diff --git a/src/features/chats/components/chat-list-item.test.tsx b/src/features/chats/components/chat-list-item.test.tsx index cd6ad0421..556cbd18c 100644 --- a/src/features/chats/components/chat-list-item.test.tsx +++ b/src/features/chats/components/chat-list-item.test.tsx @@ -1,4 +1,6 @@ import React from 'react'; +import { describe, expect, it, vi } from 'vitest'; + import { render, screen } from 'soapbox/jest/test-helpers'; import { IChat } from 'soapbox/queries/chats'; diff --git a/src/features/chats/components/chat-message-list.test.tsx b/src/features/chats/components/chat-message-list.test.tsx index 7ea47173b..0a9da18c9 100644 --- a/src/features/chats/components/chat-message-list.test.tsx +++ b/src/features/chats/components/chat-message-list.test.tsx @@ -1,6 +1,8 @@ + import userEvent from '@testing-library/user-event'; import React from 'react'; import { VirtuosoMockContext } from 'react-virtuoso'; +import { beforeEach, describe, expect, it } from 'vitest'; import { __stub } from 'soapbox/api'; import { ChatContext } from 'soapbox/contexts/chat-context'; diff --git a/src/features/chats/components/chat-message-reaction.test.tsx b/src/features/chats/components/chat-message-reaction.test.tsx index 88f102711..9c625c1b7 100644 --- a/src/features/chats/components/chat-message-reaction.test.tsx +++ b/src/features/chats/components/chat-message-reaction.test.tsx @@ -1,5 +1,7 @@ + import userEvent from '@testing-library/user-event'; import React from 'react'; +import { describe, expect, it, vi } from 'vitest'; import { render, screen } from 'soapbox/jest/test-helpers'; diff --git a/src/features/chats/components/chat-pane-header.test.tsx b/src/features/chats/components/chat-pane-header.test.tsx index a518c183a..0a328b2d5 100644 --- a/src/features/chats/components/chat-pane-header.test.tsx +++ b/src/features/chats/components/chat-pane-header.test.tsx @@ -1,5 +1,7 @@ + import userEvent from '@testing-library/user-event'; import React from 'react'; +import { describe, expect, it, vi } from 'vitest'; import { render, screen } from 'soapbox/jest/test-helpers'; diff --git a/src/features/chats/components/chat-pane/chat-pane.test.tsx b/src/features/chats/components/chat-pane/chat-pane.test.tsx index 3997c242c..72bab50ee 100644 --- a/src/features/chats/components/chat-pane/chat-pane.test.tsx +++ b/src/features/chats/components/chat-pane/chat-pane.test.tsx @@ -1,5 +1,7 @@ + import React from 'react'; import { VirtuosoMockContext } from 'react-virtuoso'; +import { beforeEach, describe, expect, it } from 'vitest'; import { __stub } from 'soapbox/api'; import { ChatContext } from 'soapbox/contexts/chat-context'; diff --git a/src/features/chats/components/chat-search/chat-search.test.tsx b/src/features/chats/components/chat-search/chat-search.test.tsx index 3555a66ae..de9a1c0d0 100644 --- a/src/features/chats/components/chat-search/chat-search.test.tsx +++ b/src/features/chats/components/chat-search/chat-search.test.tsx @@ -1,6 +1,8 @@ + import userEvent from '@testing-library/user-event'; import React from 'react'; import { VirtuosoMockContext } from 'react-virtuoso'; +import { beforeEach, describe, expect, it } from 'vitest'; import { __stub } from 'soapbox/api'; import { ChatProvider } from 'soapbox/contexts/chat-context'; diff --git a/src/features/chats/components/chat-widget.test.tsx b/src/features/chats/components/chat-widget.test.tsx index 55d2af647..cc3b02e5d 100644 --- a/src/features/chats/components/chat-widget.test.tsx +++ b/src/features/chats/components/chat-widget.test.tsx @@ -1,5 +1,7 @@ + import React from 'react'; import { Route, Switch } from 'react-router-dom'; +import { describe, expect, it } from 'vitest'; import { buildAccount } from 'soapbox/jest/factory'; import { render, rootState } from 'soapbox/jest/test-helpers'; diff --git a/src/features/compose/components/polls/duration-selector.test.tsx b/src/features/compose/components/polls/duration-selector.test.tsx index 177d735b0..02cab0f7e 100644 --- a/src/features/compose/components/polls/duration-selector.test.tsx +++ b/src/features/compose/components/polls/duration-selector.test.tsx @@ -1,5 +1,7 @@ + import userEvent from '@testing-library/user-event'; import React from 'react'; +import { describe, expect, it, vi } from 'vitest'; import { render, screen } from 'soapbox/jest/test-helpers'; diff --git a/src/features/emoji/index.test.ts b/src/features/emoji/index.test.ts index 852181044..485bfe083 100644 --- a/src/features/emoji/index.test.ts +++ b/src/features/emoji/index.test.ts @@ -1,3 +1,5 @@ +import { describe, expect, it } from 'vitest'; + import emojify from '.'; describe('emoji', () => { diff --git a/src/features/emoji/search.test.ts b/src/features/emoji/search.test.ts index 40c71df6c..3ef806d83 100644 --- a/src/features/emoji/search.test.ts +++ b/src/features/emoji/search.test.ts @@ -1,5 +1,7 @@ + import { List, Map } from 'immutable'; import pick from 'lodash/pick'; +import { describe, expect, it } from 'vitest'; import search, { addCustomToPool } from './search'; diff --git a/src/features/group/components/group-action-button.test.tsx b/src/features/group/components/group-action-button.test.tsx index adbaa658a..dd24dfb48 100644 --- a/src/features/group/components/group-action-button.test.tsx +++ b/src/features/group/components/group-action-button.test.tsx @@ -1,4 +1,6 @@ import React from 'react'; +import { beforeEach, describe, expect, it } from 'vitest'; + import { buildGroup, buildGroupRelationship } from 'soapbox/jest/factory'; import { render, screen } from 'soapbox/jest/test-helpers'; diff --git a/src/features/group/components/group-header.test.tsx b/src/features/group/components/group-header.test.tsx index 64e7fbb62..4481bef31 100644 --- a/src/features/group/components/group-header.test.tsx +++ b/src/features/group/components/group-header.test.tsx @@ -1,4 +1,6 @@ import React from 'react'; +import { describe, expect, it } from 'vitest'; + import { buildGroup } from 'soapbox/jest/factory'; import { render, screen } from 'soapbox/jest/test-helpers'; diff --git a/src/features/group/components/group-member-count.test.tsx b/src/features/group/components/group-member-count.test.tsx index f9f3231b1..a64837d37 100644 --- a/src/features/group/components/group-member-count.test.tsx +++ b/src/features/group/components/group-member-count.test.tsx @@ -1,4 +1,6 @@ import React from 'react'; +import { beforeEach, describe, expect, it } from 'vitest'; + import { buildGroup } from 'soapbox/jest/factory'; import { render, screen } from 'soapbox/jest/test-helpers'; diff --git a/src/features/group/components/group-member-list-item.test.tsx b/src/features/group/components/group-member-list-item.test.tsx index e91901013..923b54c64 100644 --- a/src/features/group/components/group-member-list-item.test.tsx +++ b/src/features/group/components/group-member-list-item.test.tsx @@ -1,5 +1,7 @@ + import userEvent from '@testing-library/user-event'; import React from 'react'; +import { beforeEach, describe, expect, it } from 'vitest'; import { __stub } from 'soapbox/api'; import { buildGroup, buildGroupMember, buildGroupRelationship } from 'soapbox/jest/factory'; diff --git a/src/features/group/components/group-options-button.test.tsx b/src/features/group/components/group-options-button.test.tsx index 42ecb6504..441f335c2 100644 --- a/src/features/group/components/group-options-button.test.tsx +++ b/src/features/group/components/group-options-button.test.tsx @@ -1,4 +1,6 @@ import React from 'react'; +import { beforeEach, describe, expect, it } from 'vitest'; + import { buildGroup, buildGroupRelationship } from 'soapbox/jest/factory'; import { render, screen } from 'soapbox/jest/test-helpers'; diff --git a/src/features/group/components/group-privacy.test.tsx b/src/features/group/components/group-privacy.test.tsx index 9e8bc8bcf..1544cf0b4 100644 --- a/src/features/group/components/group-privacy.test.tsx +++ b/src/features/group/components/group-privacy.test.tsx @@ -1,4 +1,6 @@ import React from 'react'; +import { beforeEach, describe, expect, it } from 'vitest'; + import { buildGroup } from 'soapbox/jest/factory'; import { render, screen } from 'soapbox/jest/test-helpers'; diff --git a/src/features/group/components/group-relationship.test.tsx b/src/features/group/components/group-relationship.test.tsx index 9befcc928..63999a5b1 100644 --- a/src/features/group/components/group-relationship.test.tsx +++ b/src/features/group/components/group-relationship.test.tsx @@ -1,4 +1,6 @@ import React from 'react'; +import { beforeEach, describe, expect, it } from 'vitest'; + import { buildGroup, buildGroupRelationship } from 'soapbox/jest/factory'; import { render, screen } from 'soapbox/jest/test-helpers'; diff --git a/src/features/group/components/group-tag-list-item.test.tsx b/src/features/group/components/group-tag-list-item.test.tsx index 57c3cffbe..c88160931 100644 --- a/src/features/group/components/group-tag-list-item.test.tsx +++ b/src/features/group/components/group-tag-list-item.test.tsx @@ -1,4 +1,6 @@ import React from 'react'; +import { describe, expect, it } from 'vitest'; + import { buildGroup, buildGroupTag, buildGroupRelationship } from 'soapbox/jest/factory'; import { render, screen } from 'soapbox/jest/test-helpers'; diff --git a/src/features/groups/components/discover/group-grid-item.test.tsx b/src/features/groups/components/discover/group-grid-item.test.tsx index 054335dbe..253abf0e8 100644 --- a/src/features/groups/components/discover/group-grid-item.test.tsx +++ b/src/features/groups/components/discover/group-grid-item.test.tsx @@ -1,4 +1,6 @@ import React from 'react'; +import { describe, expect, it } from 'vitest'; + import { buildGroup } from 'soapbox/jest/factory'; import { render, screen } from 'soapbox/jest/test-helpers'; diff --git a/src/features/groups/components/discover/group-list-item.test.tsx b/src/features/groups/components/discover/group-list-item.test.tsx index 5046389f8..4181a0861 100644 --- a/src/features/groups/components/discover/group-list-item.test.tsx +++ b/src/features/groups/components/discover/group-list-item.test.tsx @@ -1,4 +1,6 @@ import React from 'react'; +import { describe, expect, it } from 'vitest'; + import { buildGroup } from 'soapbox/jest/factory'; import { render, screen } from 'soapbox/jest/test-helpers'; diff --git a/src/features/groups/components/discover/layout-buttons.test.tsx b/src/features/groups/components/discover/layout-buttons.test.tsx index a372d8058..8c8f4d98a 100644 --- a/src/features/groups/components/discover/layout-buttons.test.tsx +++ b/src/features/groups/components/discover/layout-buttons.test.tsx @@ -1,5 +1,7 @@ + import userEvent from '@testing-library/user-event'; import React from 'react'; +import { describe, expect, it, vi } from 'vitest'; import { render, screen, within } from 'soapbox/jest/test-helpers'; diff --git a/src/features/groups/components/discover/search/blankslate.test.tsx b/src/features/groups/components/discover/search/blankslate.test.tsx index 8b6e811be..1d60e41d6 100644 --- a/src/features/groups/components/discover/search/blankslate.test.tsx +++ b/src/features/groups/components/discover/search/blankslate.test.tsx @@ -1,4 +1,6 @@ import React from 'react'; +import { describe, expect, it } from 'vitest'; + import { render, screen } from 'soapbox/jest/test-helpers'; diff --git a/src/features/groups/components/discover/search/results.test.tsx b/src/features/groups/components/discover/search/results.test.tsx index 1c3017c9b..ac9e30715 100644 --- a/src/features/groups/components/discover/search/results.test.tsx +++ b/src/features/groups/components/discover/search/results.test.tsx @@ -1,6 +1,8 @@ + import userEvent from '@testing-library/user-event'; import React from 'react'; import { VirtuosoGridMockContext, VirtuosoMockContext } from 'react-virtuoso'; +import { describe, expect, it, vi } from 'vitest'; import { buildAccount, buildGroup } from 'soapbox/jest/factory'; import { render, screen, waitFor } from 'soapbox/jest/test-helpers'; diff --git a/src/features/groups/components/discover/search/search.test.tsx b/src/features/groups/components/discover/search/search.test.tsx index 0ae0f8cd8..62ad7de3c 100644 --- a/src/features/groups/components/discover/search/search.test.tsx +++ b/src/features/groups/components/discover/search/search.test.tsx @@ -1,4 +1,6 @@ import React from 'react'; +import { beforeEach, describe, expect, it, vi } from 'vitest'; + import { __stub } from 'soapbox/api'; import { buildGroup } from 'soapbox/jest/factory'; diff --git a/src/features/groups/components/discover/tag-list-item.test.tsx b/src/features/groups/components/discover/tag-list-item.test.tsx index 6d8485d99..a74d89d81 100644 --- a/src/features/groups/components/discover/tag-list-item.test.tsx +++ b/src/features/groups/components/discover/tag-list-item.test.tsx @@ -1,4 +1,6 @@ import React from 'react'; +import { describe, expect, it } from 'vitest'; + import { buildGroupTag } from 'soapbox/jest/factory'; import { render, screen } from 'soapbox/jest/test-helpers'; diff --git a/src/features/groups/discover.test.tsx b/src/features/groups/discover.test.tsx index 349999e7a..836f44c53 100644 --- a/src/features/groups/discover.test.tsx +++ b/src/features/groups/discover.test.tsx @@ -1,5 +1,7 @@ + import userEvent from '@testing-library/user-event'; import React from 'react'; +import { describe, expect, it, vi } from 'vitest'; import { buildAccount } from 'soapbox/jest/factory'; import { render, screen, waitFor } from 'soapbox/jest/test-helpers'; diff --git a/src/features/notifications/components/notification.test.tsx b/src/features/notifications/components/notification.test.tsx index 7a99bdb6c..84e8edd79 100644 --- a/src/features/notifications/components/notification.test.tsx +++ b/src/features/notifications/components/notification.test.tsx @@ -1,4 +1,6 @@ import React from 'react'; +import { describe, expect, it } from 'vitest'; + import { updateNotifications } from 'soapbox/actions/notifications'; import { render, screen, rootState, createTestStore } from 'soapbox/jest/test-helpers'; diff --git a/src/features/ui/components/compose-button.test.tsx b/src/features/ui/components/compose-button.test.tsx index 8e2b24b57..29dd596d5 100644 --- a/src/features/ui/components/compose-button.test.tsx +++ b/src/features/ui/components/compose-button.test.tsx @@ -1,8 +1,10 @@ + import { fireEvent, render, screen } from '@testing-library/react'; import React from 'react'; import { IntlProvider } from 'react-intl'; import { Provider } from 'react-redux'; import { MemoryRouter } from 'react-router-dom'; +import { describe, expect, it } from 'vitest'; import { MODAL_CLOSE, MODAL_OPEN } from 'soapbox/actions/modals'; import { mockStore, rootState } from 'soapbox/jest/test-helpers'; diff --git a/src/features/ui/components/cta-banner.test.tsx b/src/features/ui/components/cta-banner.test.tsx index 3e8502027..ac189ec17 100644 --- a/src/features/ui/components/cta-banner.test.tsx +++ b/src/features/ui/components/cta-banner.test.tsx @@ -1,4 +1,6 @@ import React from 'react'; +import { describe, expect, it } from 'vitest'; + import { storeClosed, storeLoggedIn, storeOpen } from 'soapbox/jest/mock-stores'; import { render, screen } from 'soapbox/jest/test-helpers'; diff --git a/src/features/ui/components/modals/landing-page-modal.test.tsx b/src/features/ui/components/modals/landing-page-modal.test.tsx index 80d49740b..b5a4861f0 100644 --- a/src/features/ui/components/modals/landing-page-modal.test.tsx +++ b/src/features/ui/components/modals/landing-page-modal.test.tsx @@ -1,4 +1,6 @@ import React from 'react'; +import { describe, expect, it } from 'vitest'; + import { storeOpen } from 'soapbox/jest/mock-stores'; import { render, screen } from 'soapbox/jest/test-helpers'; diff --git a/src/features/ui/components/modals/unauthorized-modal.test.tsx b/src/features/ui/components/modals/unauthorized-modal.test.tsx index e283ec7b5..d40f1dc71 100644 --- a/src/features/ui/components/modals/unauthorized-modal.test.tsx +++ b/src/features/ui/components/modals/unauthorized-modal.test.tsx @@ -1,4 +1,6 @@ import React from 'react'; +import { describe, expect, it } from 'vitest'; + import { storeOpen } from 'soapbox/jest/mock-stores'; import { render, screen } from 'soapbox/jest/test-helpers'; diff --git a/src/features/ui/components/navbar.test.tsx b/src/features/ui/components/navbar.test.tsx index aa9d32815..bc7876465 100644 --- a/src/features/ui/components/navbar.test.tsx +++ b/src/features/ui/components/navbar.test.tsx @@ -1,4 +1,6 @@ import React from 'react'; +import { describe, expect, it } from 'vitest'; + import { storeOpen } from 'soapbox/jest/mock-stores'; import { render, screen } from 'soapbox/jest/test-helpers'; diff --git a/src/features/ui/components/panels/sign-up-panel.test.tsx b/src/features/ui/components/panels/sign-up-panel.test.tsx index 74a7f2bee..c20c1910e 100644 --- a/src/features/ui/components/panels/sign-up-panel.test.tsx +++ b/src/features/ui/components/panels/sign-up-panel.test.tsx @@ -1,4 +1,6 @@ import React from 'react'; +import { describe, expect, it } from 'vitest'; + import { storeOpen } from 'soapbox/jest/mock-stores'; import { render, screen } from 'soapbox/jest/test-helpers'; diff --git a/src/features/ui/components/subscribe-button.test.tsx b/src/features/ui/components/subscribe-button.test.tsx index 2e67fe272..69418950c 100644 --- a/src/features/ui/components/subscribe-button.test.tsx +++ b/src/features/ui/components/subscribe-button.test.tsx @@ -1,4 +1,6 @@ import React from 'react'; +import { describe, expect, it } from 'vitest'; + import { buildAccount, buildRelationship } from 'soapbox/jest/factory'; import { render, screen } from 'soapbox/jest/test-helpers'; diff --git a/src/features/ui/components/trends-panel.test.tsx b/src/features/ui/components/trends-panel.test.tsx index 4ea1dca44..690f5a707 100644 --- a/src/features/ui/components/trends-panel.test.tsx +++ b/src/features/ui/components/trends-panel.test.tsx @@ -1,4 +1,6 @@ import React from 'react'; +import { beforeEach, describe, expect, it } from 'vitest'; + import { __stub } from 'soapbox/api'; import { queryClient, render, screen, waitFor } from 'soapbox/jest/test-helpers'; diff --git a/src/hooks/__mocks__/resize-observer.ts b/src/hooks/__mocks__/resize-observer.ts index 172645825..caa4466d8 100644 --- a/src/hooks/__mocks__/resize-observer.ts +++ b/src/hooks/__mocks__/resize-observer.ts @@ -1,3 +1,5 @@ +import { vi } from 'vitest'; + let listener: ((rect: any) => void) | undefined = undefined; const mockDisconnect = vi.fn(); diff --git a/src/hooks/useDimensions.test.ts b/src/hooks/useDimensions.test.ts index 14f8b2587..84242df3f 100644 --- a/src/hooks/useDimensions.test.ts +++ b/src/hooks/useDimensions.test.ts @@ -1,4 +1,6 @@ import { renderHook, act } from '@testing-library/react-hooks'; +import { beforeEach, describe, expect, it } from 'vitest'; + import { listener, mockDisconnect } from './__mocks__/resize-observer'; import { useDimensions } from './useDimensions'; diff --git a/src/jest/test-helpers.tsx b/src/jest/test-helpers.tsx index 06087e9ca..7aeac78cc 100644 --- a/src/jest/test-helpers.tsx +++ b/src/jest/test-helpers.tsx @@ -10,6 +10,7 @@ import { Provider } from 'react-redux'; import { MemoryRouter } from 'react-router-dom'; import { Action, applyMiddleware, createStore } from 'redux'; import { thunk } from 'redux-thunk'; +import { afterAll, beforeAll } from 'vitest'; import { ChatProvider } from 'soapbox/contexts/chat-context'; import { StatProvider } from 'soapbox/contexts/stat-context'; diff --git a/src/jest/test-setup.ts b/src/jest/test-setup.ts index e923323b5..0f0e5ac90 100644 --- a/src/jest/test-setup.ts +++ b/src/jest/test-setup.ts @@ -2,6 +2,8 @@ import { act } from '@testing-library/react'; import { toast } from 'react-hot-toast'; // eslint-disable-next-line import/no-extraneous-dependencies import '@testing-library/jest-dom/vitest'; +import 'fake-indexeddb/auto'; +import { afterEach, vi } from 'vitest'; import { __clear as clearApiMocks } from '../api/__mocks__'; @@ -14,10 +16,6 @@ afterEach(() => { // Query mocking vi.mock('soapbox/queries/client'); -// Mock IndexedDB -// https://dev.to/andyhaskell/testing-your-indexeddb-code-with-jest-2o17 -import 'fake-indexeddb/auto'; - // Clear toasts after each test. afterEach(() => { act(() => { diff --git a/src/normalizers/account.test.ts b/src/normalizers/account.test.ts index 15a26ecdc..5adcb2213 100644 --- a/src/normalizers/account.test.ts +++ b/src/normalizers/account.test.ts @@ -1,4 +1,6 @@ import { Record as ImmutableRecord, fromJS } from 'immutable'; +import { describe, expect, it } from 'vitest'; + import AVATAR_MISSING from 'soapbox/assets/images/avatar-missing.png'; import HEADER_MISSING from 'soapbox/assets/images/header-missing.png'; diff --git a/src/normalizers/attachment.test.ts b/src/normalizers/attachment.test.ts index f093b3243..a1b15f1fa 100644 --- a/src/normalizers/attachment.test.ts +++ b/src/normalizers/attachment.test.ts @@ -1,4 +1,6 @@ import { Record as ImmutableRecord } from 'immutable'; +import { describe, expect, it } from 'vitest'; + import { normalizeAttachment } from './attachment'; diff --git a/src/normalizers/chat-message.test.ts b/src/normalizers/chat-message.test.ts index 83ab5c0ba..db3241dd4 100644 --- a/src/normalizers/chat-message.test.ts +++ b/src/normalizers/chat-message.test.ts @@ -1,4 +1,6 @@ import { Record as ImmutableRecord } from 'immutable'; +import { describe, expect, it } from 'vitest'; + import { normalizeAttachment } from './attachment'; import { normalizeChatMessage } from './chat-message'; diff --git a/src/normalizers/mention.test.ts b/src/normalizers/mention.test.ts index 90ffee65a..320e5a405 100644 --- a/src/normalizers/mention.test.ts +++ b/src/normalizers/mention.test.ts @@ -1,4 +1,6 @@ import { Record as ImmutableRecord } from 'immutable'; +import { describe, expect, it } from 'vitest'; + import { normalizeMention } from './mention'; diff --git a/src/normalizers/notification.test.ts b/src/normalizers/notification.test.ts index bb28b3c58..23778edb8 100644 --- a/src/normalizers/notification.test.ts +++ b/src/normalizers/notification.test.ts @@ -1,4 +1,6 @@ import { Record as ImmutableRecord } from 'immutable'; +import { describe, expect, it } from 'vitest'; + import { normalizeNotification } from './notification'; diff --git a/src/normalizers/soapbox/soapbox-config.test.ts b/src/normalizers/soapbox/soapbox-config.test.ts index e142c09d7..8a96af49f 100644 --- a/src/normalizers/soapbox/soapbox-config.test.ts +++ b/src/normalizers/soapbox/soapbox-config.test.ts @@ -1,4 +1,6 @@ import { Record as ImmutableRecord } from 'immutable'; +import { describe, expect, it } from 'vitest'; + import { normalizeSoapboxConfig } from './soapbox-config'; diff --git a/src/normalizers/status.test.ts b/src/normalizers/status.test.ts index e5bf6b2c8..935271892 100644 --- a/src/normalizers/status.test.ts +++ b/src/normalizers/status.test.ts @@ -1,4 +1,6 @@ import { Record as ImmutableRecord, fromJS } from 'immutable'; +import { describe, expect, it } from 'vitest'; + import { normalizeStatus } from './status'; diff --git a/src/queries/chats.test.ts b/src/queries/chats.test.ts index 003017b84..c2b536a18 100644 --- a/src/queries/chats.test.ts +++ b/src/queries/chats.test.ts @@ -1,6 +1,8 @@ + import { Map as ImmutableMap } from 'immutable'; import sumBy from 'lodash/sumBy'; import { useEffect } from 'react'; +import { beforeEach, describe, expect, it } from 'vitest'; import { __stub } from 'soapbox/api'; import { buildAccount, buildRelationship } from 'soapbox/jest/factory'; diff --git a/src/queries/relationships.test.ts b/src/queries/relationships.test.ts index 2c6e3ec8f..88966a801 100644 --- a/src/queries/relationships.test.ts +++ b/src/queries/relationships.test.ts @@ -1,4 +1,6 @@ import { useEffect } from 'react'; +import { beforeEach, describe, expect, it } from 'vitest'; + import { __stub } from 'soapbox/api'; import { buildRelationship } from 'soapbox/jest/factory'; diff --git a/src/queries/suggestions.test.ts b/src/queries/suggestions.test.ts index 4618cb6e7..59b07e808 100644 --- a/src/queries/suggestions.test.ts +++ b/src/queries/suggestions.test.ts @@ -1,3 +1,5 @@ +import { beforeEach, describe, expect, it } from 'vitest'; + import { __stub } from 'soapbox/api'; import { renderHook, waitFor } from 'soapbox/jest/test-helpers'; diff --git a/src/queries/trends.test.ts b/src/queries/trends.test.ts index 36a590c07..ec7b15a30 100644 --- a/src/queries/trends.test.ts +++ b/src/queries/trends.test.ts @@ -1,3 +1,5 @@ +import { beforeEach, describe, expect, it } from 'vitest'; + import { __stub } from 'soapbox/api'; import { queryClient, renderHook, waitFor } from 'soapbox/jest/test-helpers'; diff --git a/src/reducers/admin.test.ts b/src/reducers/admin.test.ts index fa4e26959..a37c3e60e 100644 --- a/src/reducers/admin.test.ts +++ b/src/reducers/admin.test.ts @@ -1,4 +1,6 @@ import { Record as ImmutableRecord } from 'immutable'; +import { describe, expect, it } from 'vitest'; + import reducer from './admin'; diff --git a/src/reducers/compose.test.ts b/src/reducers/compose.test.ts index cee5e7170..81f277af4 100644 --- a/src/reducers/compose.test.ts +++ b/src/reducers/compose.test.ts @@ -1,4 +1,6 @@ import { List as ImmutableList, Record as ImmutableRecord, fromJS } from 'immutable'; +import { describe, expect, it } from 'vitest'; + import * as actions from 'soapbox/actions/compose'; import { COMPOSE_SET_STATUS } from 'soapbox/actions/compose-status'; diff --git a/src/reducers/contexts.test.ts b/src/reducers/contexts.test.ts index 0ca652784..4e724d9ec 100644 --- a/src/reducers/contexts.test.ts +++ b/src/reducers/contexts.test.ts @@ -4,6 +4,8 @@ import { fromJS, is, } from 'immutable'; +import { describe, expect, it } from 'vitest'; + import { STATUS_IMPORT } from 'soapbox/actions/importer'; import { CONTEXT_FETCH_SUCCESS } from 'soapbox/actions/statuses'; diff --git a/src/reducers/conversations.test.ts b/src/reducers/conversations.test.ts index 1f2c09276..efe085564 100644 --- a/src/reducers/conversations.test.ts +++ b/src/reducers/conversations.test.ts @@ -1,4 +1,6 @@ import { List as ImmutableList, Record as ImmutableRecord } from 'immutable'; +import { describe, expect, it } from 'vitest'; + import * as actions from 'soapbox/actions/conversations'; diff --git a/src/reducers/custom-emojis.test.ts b/src/reducers/custom-emojis.test.ts index f72df1bac..0ed8643f8 100644 --- a/src/reducers/custom-emojis.test.ts +++ b/src/reducers/custom-emojis.test.ts @@ -1,4 +1,6 @@ import { List as ImmutableList } from 'immutable'; +import { describe, expect, it } from 'vitest'; + import reducer from './custom-emojis'; diff --git a/src/reducers/domain-lists.test.ts b/src/reducers/domain-lists.test.ts index e990d2d32..6577c87e2 100644 --- a/src/reducers/domain-lists.test.ts +++ b/src/reducers/domain-lists.test.ts @@ -1,3 +1,5 @@ +import { describe, expect, it } from 'vitest'; + import reducer from './domain-lists'; describe('domain_lists reducer', () => { diff --git a/src/reducers/dropdown-menu.test.ts b/src/reducers/dropdown-menu.test.ts index 0706edf20..1ed312cec 100644 --- a/src/reducers/dropdown-menu.test.ts +++ b/src/reducers/dropdown-menu.test.ts @@ -1,3 +1,5 @@ +import { describe, expect, it } from 'vitest'; + import reducer from './dropdown-menu'; describe('dropdown_menu reducer', () => { diff --git a/src/reducers/filters.test.ts b/src/reducers/filters.test.ts index 492eff94a..025fbd61c 100644 --- a/src/reducers/filters.test.ts +++ b/src/reducers/filters.test.ts @@ -1,4 +1,6 @@ import { List as ImmutableList } from 'immutable'; +import { describe, expect, it } from 'vitest'; + import reducer from './filters'; diff --git a/src/reducers/index.test.ts b/src/reducers/index.test.ts index a3b1cf2ea..1ad39b4d7 100644 --- a/src/reducers/index.test.ts +++ b/src/reducers/index.test.ts @@ -1,4 +1,6 @@ import { Record as ImmutableRecord } from 'immutable'; +import { describe, expect, it } from 'vitest'; + import reducer from '.'; diff --git a/src/reducers/instance.test.ts b/src/reducers/instance.test.ts index 1f89d8c52..c53f9124f 100644 --- a/src/reducers/instance.test.ts +++ b/src/reducers/instance.test.ts @@ -1,3 +1,5 @@ +import { describe, expect, it } from 'vitest'; + import { ADMIN_CONFIG_UPDATE_REQUEST } from 'soapbox/actions/admin'; import reducer from './instance'; diff --git a/src/reducers/list-adder.test.ts b/src/reducers/list-adder.test.ts index 1c2153def..8692fb3d1 100644 --- a/src/reducers/list-adder.test.ts +++ b/src/reducers/list-adder.test.ts @@ -1,4 +1,6 @@ import { List as ImmutableList, Record as ImmutableRecord } from 'immutable'; +import { describe, expect, it } from 'vitest'; + import * as actions from 'soapbox/actions/lists'; diff --git a/src/reducers/lists.test.ts b/src/reducers/lists.test.ts index 911d4f3a9..af2e39a90 100644 --- a/src/reducers/lists.test.ts +++ b/src/reducers/lists.test.ts @@ -1,4 +1,6 @@ import { Map as ImmutableMap } from 'immutable'; +import { describe, expect, it } from 'vitest'; + import reducer from './lists'; diff --git a/src/reducers/me.test.ts b/src/reducers/me.test.ts index 753171d11..ac1725fcf 100644 --- a/src/reducers/me.test.ts +++ b/src/reducers/me.test.ts @@ -1,3 +1,5 @@ +import { describe, expect, it } from 'vitest'; + import reducer from './me'; describe('me reducer', () => { diff --git a/src/reducers/meta.test.ts b/src/reducers/meta.test.ts index eccf37ffc..76f370a18 100644 --- a/src/reducers/meta.test.ts +++ b/src/reducers/meta.test.ts @@ -1,4 +1,6 @@ import { Record as ImmutableRecord } from 'immutable'; +import { describe, expect, it } from 'vitest'; + import { SW_UPDATING, setSwUpdating } from 'soapbox/actions/sw'; diff --git a/src/reducers/modals.test.ts b/src/reducers/modals.test.ts index e9e05427b..17058cecb 100644 --- a/src/reducers/modals.test.ts +++ b/src/reducers/modals.test.ts @@ -1,4 +1,6 @@ import { List as ImmutableList, Record as ImmutableRecord } from 'immutable'; +import { describe, expect, it } from 'vitest'; + import { MODAL_OPEN, MODAL_CLOSE } from 'soapbox/actions/modals'; diff --git a/src/reducers/mutes.test.ts b/src/reducers/mutes.test.ts index 988c3dcdf..7bd8d9dd2 100644 --- a/src/reducers/mutes.test.ts +++ b/src/reducers/mutes.test.ts @@ -1,4 +1,6 @@ import { Record as ImmutableRecord } from 'immutable'; +import { describe, expect, it } from 'vitest'; + import { MUTES_INIT_MODAL, diff --git a/src/reducers/onboarding.test.ts b/src/reducers/onboarding.test.ts index ad157a868..65e77718f 100644 --- a/src/reducers/onboarding.test.ts +++ b/src/reducers/onboarding.test.ts @@ -1,3 +1,5 @@ +import { describe, expect, it } from 'vitest'; + import { ONBOARDING_START, ONBOARDING_END } from 'soapbox/actions/onboarding'; import reducer from './onboarding'; diff --git a/src/reducers/polls.test.ts b/src/reducers/polls.test.ts index 4ff9a555a..8d51d43e5 100644 --- a/src/reducers/polls.test.ts +++ b/src/reducers/polls.test.ts @@ -1,4 +1,6 @@ import { Map as ImmutableMap } from 'immutable'; +import { describe, expect, it } from 'vitest'; + import { POLLS_IMPORT } from 'soapbox/actions/importer'; diff --git a/src/reducers/relationships.test.ts b/src/reducers/relationships.test.ts index 28b269ede..4555d9e31 100644 --- a/src/reducers/relationships.test.ts +++ b/src/reducers/relationships.test.ts @@ -1,4 +1,6 @@ import { Map as ImmutableMap } from 'immutable'; +import { describe, expect, it } from 'vitest'; + import lain from 'soapbox/__fixtures__/lain.json'; import { ACCOUNT_IMPORT } from 'soapbox/actions/importer'; diff --git a/src/reducers/reports.test.ts b/src/reducers/reports.test.ts index 8045bbc8a..546f19154 100644 --- a/src/reducers/reports.test.ts +++ b/src/reducers/reports.test.ts @@ -1,3 +1,5 @@ +import { describe, expect, it } from 'vitest'; + import reducer from './reports'; describe('reports reducer', () => { diff --git a/src/reducers/settings.test.ts b/src/reducers/settings.test.ts index 1623a9a96..d8283e405 100644 --- a/src/reducers/settings.test.ts +++ b/src/reducers/settings.test.ts @@ -1,4 +1,6 @@ import { Map as ImmutableMap } from 'immutable'; +import { describe, expect, it } from 'vitest'; + import reducer from './settings'; diff --git a/src/reducers/sidebar.test.ts b/src/reducers/sidebar.test.ts index b9bd1274a..6f8194a9f 100644 --- a/src/reducers/sidebar.test.ts +++ b/src/reducers/sidebar.test.ts @@ -1,3 +1,5 @@ +import { describe, expect, it } from 'vitest'; + import reducer from './sidebar'; describe('sidebar reducer', () => { diff --git a/src/reducers/soapbox.test.ts b/src/reducers/soapbox.test.ts index 60e5ec5cc..19d6c5f71 100644 --- a/src/reducers/soapbox.test.ts +++ b/src/reducers/soapbox.test.ts @@ -1,4 +1,6 @@ import { Map as ImmutableMap } from 'immutable'; +import { describe, expect, it } from 'vitest'; + import soapboxConfig from 'soapbox/__fixtures__/admin_api_frontend_config.json'; import soapbox from 'soapbox/__fixtures__/soapbox.json'; diff --git a/src/reducers/status-hover-card.test.tsx b/src/reducers/status-hover-card.test.tsx index 5936ebcaa..fd1fcd7b6 100644 --- a/src/reducers/status-hover-card.test.tsx +++ b/src/reducers/status-hover-card.test.tsx @@ -1,3 +1,5 @@ +import { describe, expect, it } from 'vitest'; + import { STATUS_HOVER_CARD_OPEN, STATUS_HOVER_CARD_CLOSE, diff --git a/src/reducers/status-lists.test.ts b/src/reducers/status-lists.test.ts index e87c42e76..b032afb5f 100644 --- a/src/reducers/status-lists.test.ts +++ b/src/reducers/status-lists.test.ts @@ -1,3 +1,5 @@ +import { describe, expect, it } from 'vitest'; + import reducer from './status-lists'; describe('status_lists reducer', () => { diff --git a/src/reducers/statuses.test.ts b/src/reducers/statuses.test.ts index 824e53e56..78e987995 100644 --- a/src/reducers/statuses.test.ts +++ b/src/reducers/statuses.test.ts @@ -2,6 +2,8 @@ import { Map as ImmutableMap, Record as ImmutableRecord, } from 'immutable'; +import { describe, expect, it } from 'vitest'; + import { STATUS_IMPORT } from 'soapbox/actions/importer'; import { diff --git a/src/reducers/suggestions.test.ts b/src/reducers/suggestions.test.ts index a62067904..f78580f1d 100644 --- a/src/reducers/suggestions.test.ts +++ b/src/reducers/suggestions.test.ts @@ -1,3 +1,5 @@ +import { describe, expect, it } from 'vitest'; + import { SUGGESTIONS_FETCH_SUCCESS, SUGGESTIONS_DISMISS } from 'soapbox/actions/suggestions'; import reducer from './suggestions'; diff --git a/src/reducers/timelines.test.ts b/src/reducers/timelines.test.ts index 697523e7c..d9212e72c 100644 --- a/src/reducers/timelines.test.ts +++ b/src/reducers/timelines.test.ts @@ -1,4 +1,6 @@ import { Map as ImmutableMap, OrderedSet as ImmutableOrderedSet, Record as ImmutableRecord, fromJS } from 'immutable'; +import { describe, expect, it } from 'vitest'; + import { TIMELINE_EXPAND_REQUEST, diff --git a/src/reducers/trends.test.ts b/src/reducers/trends.test.ts index 79ee44ed3..4f9dfc46b 100644 --- a/src/reducers/trends.test.ts +++ b/src/reducers/trends.test.ts @@ -1,3 +1,5 @@ +import { describe, expect, it } from 'vitest'; + import reducer from './trends'; describe('trends reducer', () => { diff --git a/src/reducers/user-lists.test.ts b/src/reducers/user-lists.test.ts index a2477ada7..92bc9247d 100644 --- a/src/reducers/user-lists.test.ts +++ b/src/reducers/user-lists.test.ts @@ -1,4 +1,6 @@ import { OrderedSet as ImmutableOrderedSet } from 'immutable'; +import { describe, expect, it } from 'vitest'; + import reducer from './user-lists'; diff --git a/src/schemas/card.test.ts b/src/schemas/card.test.ts index f9b672c28..b8dbad9dd 100644 --- a/src/schemas/card.test.ts +++ b/src/schemas/card.test.ts @@ -1,3 +1,5 @@ +import { describe, expect, it } from 'vitest'; + import { cardSchema } from './card'; describe('cardSchema', () => { diff --git a/src/schemas/group.test.ts b/src/schemas/group.test.ts index b227ad856..2ebe9f7d4 100644 --- a/src/schemas/group.test.ts +++ b/src/schemas/group.test.ts @@ -1,3 +1,5 @@ +import { expect, test } from 'vitest'; + import { groupSchema } from './group'; test('groupSchema with a TruthSocial group', async () => { diff --git a/src/schemas/instance.test.ts b/src/schemas/instance.test.ts index 8d2f0f9d2..338763b66 100644 --- a/src/schemas/instance.test.ts +++ b/src/schemas/instance.test.ts @@ -1,3 +1,5 @@ +import { describe, expect, it } from 'vitest'; + import { instanceV1Schema } from './instance'; describe('instanceV1Schema.parse()', () => { diff --git a/src/schemas/poll.test.ts b/src/schemas/poll.test.ts index 88deca8db..0c47cc30f 100644 --- a/src/schemas/poll.test.ts +++ b/src/schemas/poll.test.ts @@ -1,3 +1,5 @@ +import { describe, expect, it } from 'vitest'; + import { pollSchema } from './poll'; describe('normalizePoll()', () => { diff --git a/src/toast.test.tsx b/src/toast.test.tsx index 74c105c2e..860fa35c6 100644 --- a/src/toast.test.tsx +++ b/src/toast.test.tsx @@ -1,8 +1,10 @@ + import { render } from '@testing-library/react'; import { AxiosError, AxiosHeaders } from 'axios'; import React from 'react'; import { Toaster } from 'react-hot-toast'; import { IntlProvider } from 'react-intl'; +import { afterAll, afterEach, beforeAll, describe, expect, it, vi } from 'vitest'; import { act, screen } from 'soapbox/jest/test-helpers'; diff --git a/src/utils/badges.test.ts b/src/utils/badges.test.ts index e2e7e78d3..d11218579 100644 --- a/src/utils/badges.test.ts +++ b/src/utils/badges.test.ts @@ -1,3 +1,5 @@ +import { expect, test } from 'vitest'; + import { buildAccount } from 'soapbox/jest/factory'; import { diff --git a/src/utils/base64.test.ts b/src/utils/base64.test.ts index d2537d99b..5ee19e901 100644 --- a/src/utils/base64.test.ts +++ b/src/utils/base64.test.ts @@ -1,3 +1,5 @@ +import { describe, expect, it } from 'vitest'; + import { decodeBase64 } from './base64'; describe('decodeBase64', () => { diff --git a/src/utils/chats.test.ts b/src/utils/chats.test.ts index c7eb306c3..3db16e42b 100644 --- a/src/utils/chats.test.ts +++ b/src/utils/chats.test.ts @@ -1,3 +1,5 @@ +import { beforeEach, describe, expect, it } from 'vitest'; + import { buildAccount } from 'soapbox/jest/factory'; import { normalizeChatMessage } from 'soapbox/normalizers'; import { ChatKeys, IChat } from 'soapbox/queries/chats'; diff --git a/src/utils/colors.test.ts b/src/utils/colors.test.ts index 787d5886e..fbe17a12a 100644 --- a/src/utils/colors.test.ts +++ b/src/utils/colors.test.ts @@ -1,3 +1,5 @@ +import { describe, expect, it } from 'vitest'; + import tintify from './colors'; const AZURE = '#0482d8'; diff --git a/src/utils/comparators.test.ts b/src/utils/comparators.test.ts index c84e6982c..f86152053 100644 --- a/src/utils/comparators.test.ts +++ b/src/utils/comparators.test.ts @@ -1,3 +1,5 @@ +import { expect, test } from 'vitest'; + import { compareId } from './comparators'; test('compareId', () => { diff --git a/src/utils/config-db.test.ts b/src/utils/config-db.test.ts index db6a423cf..ee868331a 100644 --- a/src/utils/config-db.test.ts +++ b/src/utils/config-db.test.ts @@ -1,4 +1,6 @@ import { List as ImmutableList, fromJS } from 'immutable'; +import { expect, test } from 'vitest'; + import config_db from 'soapbox/__fixtures__/config_db.json'; diff --git a/src/utils/emoji-reacts.test.ts b/src/utils/emoji-reacts.test.ts index af2c5c34b..cce514bd0 100644 --- a/src/utils/emoji-reacts.test.ts +++ b/src/utils/emoji-reacts.test.ts @@ -1,4 +1,6 @@ import { List as ImmutableList, fromJS } from 'immutable'; +import { describe, expect, it } from 'vitest'; + import { normalizeStatus } from 'soapbox/normalizers'; import { emojiReactionSchema } from 'soapbox/schemas'; diff --git a/src/utils/emoji.test.ts b/src/utils/emoji.test.ts index 9880589c2..f30a967a6 100644 --- a/src/utils/emoji.test.ts +++ b/src/utils/emoji.test.ts @@ -1,3 +1,5 @@ +import { describe, expect, it } from 'vitest'; + import { removeVS16s, toCodePoints, diff --git a/src/utils/features.test.ts b/src/utils/features.test.ts index 248085876..fb028a7ec 100644 --- a/src/utils/features.test.ts +++ b/src/utils/features.test.ts @@ -1,3 +1,5 @@ +import { describe, expect, it } from 'vitest'; + import { buildInstance } from 'soapbox/jest/factory'; import { diff --git a/src/utils/html.test.ts b/src/utils/html.test.ts index cf0a62d1d..50648eb99 100644 --- a/src/utils/html.test.ts +++ b/src/utils/html.test.ts @@ -1,3 +1,5 @@ +import { describe, expect, it } from 'vitest'; + import * as html from './html'; describe('html', () => { diff --git a/src/utils/input.test.ts b/src/utils/input.test.ts index 4630126ea..2bd287420 100644 --- a/src/utils/input.test.ts +++ b/src/utils/input.test.ts @@ -1,3 +1,5 @@ +import { expect, test } from 'vitest'; + import { normalizeUsername } from './input'; test('normalizeUsername', () => { diff --git a/src/utils/media.test.ts b/src/utils/media.test.ts index cbfdac026..2287e2592 100644 --- a/src/utils/media.test.ts +++ b/src/utils/media.test.ts @@ -1,3 +1,5 @@ +import { describe, expect, it } from 'vitest'; + import { addAutoPlay } from './media'; describe('addAutoPlay()', () => { diff --git a/src/utils/numbers.test.tsx b/src/utils/numbers.test.tsx index 1d69e960d..d194678ce 100644 --- a/src/utils/numbers.test.tsx +++ b/src/utils/numbers.test.tsx @@ -1,4 +1,6 @@ import React from 'react'; +import { describe, expect, test } from 'vitest'; + import { render, screen } from 'soapbox/jest/test-helpers'; diff --git a/src/utils/queries.test.ts b/src/utils/queries.test.ts index 72e1f809e..88629bbf2 100644 --- a/src/utils/queries.test.ts +++ b/src/utils/queries.test.ts @@ -1,4 +1,6 @@ import { InfiniteData } from '@tanstack/react-query'; +import { beforeEach, describe, expect, it } from 'vitest'; + import { queryClient } from 'soapbox/queries/client'; diff --git a/src/utils/status.test.ts b/src/utils/status.test.ts index 4cdb8f8f5..22b5a2d52 100644 --- a/src/utils/status.test.ts +++ b/src/utils/status.test.ts @@ -1,3 +1,5 @@ +import { describe, expect, it } from 'vitest'; + import { buildStatus } from 'soapbox/jest/factory'; diff --git a/src/utils/tailwind.test.ts b/src/utils/tailwind.test.ts index f234d5ac3..7e1374356 100644 --- a/src/utils/tailwind.test.ts +++ b/src/utils/tailwind.test.ts @@ -1,4 +1,6 @@ import { Map as ImmutableMap } from 'immutable'; +import { describe, expect, it } from 'vitest'; + import { toTailwind, fromLegacyColors, expandPalette } from './tailwind'; diff --git a/src/utils/timelines.test.ts b/src/utils/timelines.test.ts index 9d27265f1..17d6e2585 100644 --- a/src/utils/timelines.test.ts +++ b/src/utils/timelines.test.ts @@ -1,4 +1,6 @@ import { fromJS } from 'immutable'; +import { describe, expect, it } from 'vitest'; + import { buildStatus } from 'soapbox/jest/factory'; diff --git a/tailwind/colors.test.ts b/tailwind/colors.test.ts index 426de1db2..eee8eb41b 100644 --- a/tailwind/colors.test.ts +++ b/tailwind/colors.test.ts @@ -1,3 +1,5 @@ +import { describe, expect, it } from 'vitest'; + import { withOpacityValue, parseColorMatrix, diff --git a/tsconfig.json b/tsconfig.json index 806a33b46..8eed381dd 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -23,7 +23,6 @@ ], "types": [ "vite/client", - "vitest/globals", "vite-plugin-compile-time/client", "@webbtc/webln-types" ] diff --git a/vite.config.ts b/vite.config.ts index 7ad188c2c..797cf5115 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,5 +1,5 @@ /* eslint-disable quotes */ -/// +/// import fs from 'node:fs'; import { fileURLToPath, URL } from 'node:url';