v3: deno check src/ passes again — the tests import userEvent by name — 71 errors, all the same one: @testing-library/user-event 14.6.7 ships ESM-syntax declarations without "type": "module", so Deno reads them as CommonJS and the default import is the module namespace, on which setup() and click() don't exist. Vite resolves it the other way, which is why the suite still ran. The package exports userEvent by name as well; the 40 test files that imported it use that now. No behaviour changes; the 627 tests pass and the lint is clean.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
khannurien
2026-09-27 19:49:41 +00:00
parent 2b6e68391b
commit e9f6a1f23e
40 changed files with 40 additions and 40 deletions

View File

@@ -1,6 +1,6 @@
import { describe, expect, test, vi } from "vitest";
import { screen } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { userEvent } from "@testing-library/user-event";
import { CategorySelect } from "../../../components/category/CategorySelect.tsx";
import type { Category } from "../../../model.ts";
import { makeCategory } from "../../fixtures.ts";

View File

@@ -1,6 +1,6 @@
import { describe, expect, test } from "vitest";
import { screen } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { userEvent } from "@testing-library/user-event";
import { CategorySwitcher } from "../../../components/category/CategorySwitcher.tsx";
import type { Category } from "../../../model.ts";
import { makeCategory } from "../../fixtures.ts";

View File

@@ -1,6 +1,6 @@
import { describe, expect, test, vi } from "vitest";
import { act, screen, waitFor, within } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { userEvent } from "@testing-library/user-event";
import { ChatModal } from "../../../components/chat/ChatModal.tsx";
import type { AuthResponse, ChatMessage } from "../../../model.ts";
import { calls, fail, route } from "../../fetch.ts";

View File

@@ -1,6 +1,6 @@
import { describe, expect, test, vi } from "vitest";
import { screen, waitFor, within } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { userEvent } from "@testing-library/user-event";
import { useState } from "react";
import { CommentThread } from "../../../components/comment/CommentThread.tsx";
import type { AuthResponse, Comment } from "../../../model.ts";

View File

@@ -1,6 +1,6 @@
import { describe, expect, test, vi } from "vitest";
import { screen, within } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { userEvent } from "@testing-library/user-event";
import { DumpCard } from "../../../components/dump/DumpCard.tsx";
import { markDumpVisited } from "../../../utils/shared/visited.ts";
import { makeCategory, makeDump, makeSession } from "../../fixtures.ts";

View File

@@ -1,6 +1,6 @@
import { describe, expect, test, vi } from "vitest";
import { screen } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { userEvent } from "@testing-library/user-event";
import { FilePreview } from "../../../components/dump/FilePreview.tsx";
import { makeDump, makeSession } from "../../fixtures.ts";
import { renderWithContexts } from "../../render.tsx";

View File

@@ -1,6 +1,6 @@
import { describe, expect, test, vi } from "vitest";
import { within } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { userEvent } from "@testing-library/user-event";
import { JournalCard } from "../../../components/dump/JournalCard.tsx";
import { makeDump } from "../../fixtures.ts";
import { currentPath, renderWithContexts } from "../../render.tsx";

View File

@@ -1,6 +1,6 @@
import { describe, expect, test, vi } from "vitest";
import { screen } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { userEvent } from "@testing-library/user-event";
import { RichContentCard } from "../../../components/dump/RichContentCard.tsx";
import { renderWithContexts } from "../../render.tsx";

View File

@@ -6,7 +6,7 @@ import {
waitFor,
within,
} from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { userEvent } from "@testing-library/user-event";
import { DumpCreateModal } from "../../../../components/dump/create/DumpCreateModal.tsx";
import { calls, fail, route } from "../../../fetch.ts";
import {

View File

@@ -1,6 +1,6 @@
import { describe, expect, test } from "vitest";
import { screen } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { userEvent } from "@testing-library/user-event";
import { Markdown } from "../../../components/editor/Markdown.tsx";
import { currentPath, renderWithContexts } from "../../render.tsx";

View File

@@ -6,7 +6,7 @@ import {
waitFor,
within,
} from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { userEvent } from "@testing-library/user-event";
import { createRef, useState } from "react";
import {
TextEditor,

View File

@@ -1,6 +1,6 @@
import { describe, expect, test } from "vitest";
import { screen } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { userEvent } from "@testing-library/user-event";
import { FeedTabBar } from "../../../components/feed/FeedTabBar.tsx";
import type { Category } from "../../../model.ts";
import { makeCategory, makeSession } from "../../fixtures.ts";

View File

@@ -1,6 +1,6 @@
import { afterEach, describe, expect, test } from "vitest";
import { render, screen, waitFor } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { userEvent } from "@testing-library/user-event";
import { I18nProvider } from "@lingui/react";
import { i18n } from "@lingui/core";
import { BrowserRouter, Route, Routes, useLocation } from "react-router";

View File

@@ -1,6 +1,6 @@
import { describe, expect, test, vi } from "vitest";
import { screen, waitFor } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { userEvent } from "@testing-library/user-event";
import { ChatButton } from "../../../components/layout/ChatButton.tsx";
import { ChatContext } from "../../../contexts/chat/ChatContext.ts";
import { renderWithContexts } from "../../render.tsx";

View File

@@ -1,6 +1,6 @@
import { describe, expect, test, vi } from "vitest";
import { act, screen } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { userEvent } from "@testing-library/user-event";
import { NotificationBell } from "../../../components/layout/NotificationBell.tsx";
import { makeNotification } from "../../fixtures.ts";
import { currentPath, renderWithContexts } from "../../render.tsx";

View File

@@ -1,6 +1,6 @@
import { describe, expect, test, vi } from "vitest";
import { screen } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { userEvent } from "@testing-library/user-event";
import { useState } from "react";
import { SearchBar } from "../../../components/layout/SearchBar.tsx";
import { renderWithContexts } from "../../render.tsx";

View File

@@ -1,6 +1,6 @@
import { describe, expect, test } from "vitest";
import { screen } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { userEvent } from "@testing-library/user-event";
import { UserMenu } from "../../../components/layout/UserMenu.tsx";
import { makeUser } from "../../fixtures.ts";
import { currentPath, renderWithContexts } from "../../render.tsx";

View File

@@ -1,6 +1,6 @@
import { describe, expect, test } from "vitest";
import { act, screen, within } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { userEvent } from "@testing-library/user-event";
import { useContext } from "react";
import { GlobalPlayer } from "../../../components/player/GlobalPlayer.tsx";
import { PlayerProvider } from "../../../contexts/player/PlayerProvider.tsx";

View File

@@ -1,6 +1,6 @@
import { describe, expect, test, vi } from "vitest";
import { act, fireEvent, screen, waitFor } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { userEvent } from "@testing-library/user-event";
import { MediaPlayer } from "../../../components/player/MediaPlayer.tsx";
import { renderWithContexts } from "../../render.tsx";

View File

@@ -1,6 +1,6 @@
import { describe, expect, test, vi } from "vitest";
import { screen } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { userEvent } from "@testing-library/user-event";
import { PlaylistCard } from "../../../components/playlist/PlaylistCard.tsx";
import { makePlaylist } from "../../fixtures.ts";
import { currentPath, renderWithContexts } from "../../render.tsx";

View File

@@ -1,6 +1,6 @@
import { describe, expect, test, vi } from "vitest";
import { render, screen } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { userEvent } from "@testing-library/user-event";
import { I18nProvider } from "@lingui/react";
import { i18n } from "@lingui/core";
import { useState } from "react";

View File

@@ -1,6 +1,6 @@
import { describe, expect, test, vi } from "vitest";
import { render, screen } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { userEvent } from "@testing-library/user-event";
import { I18nProvider } from "@lingui/react";
import { i18n } from "@lingui/core";
import { Modal } from "../../../components/shared/Modal.tsx";

View File

@@ -1,6 +1,6 @@
import { describe, expect, test, vi } from "vitest";
import { screen } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { userEvent } from "@testing-library/user-event";
import { TabBar } from "../../../components/shared/TabBar.tsx";
import { renderWithContexts } from "../../render.tsx";

View File

@@ -1,6 +1,6 @@
import { describe, expect, test } from "vitest";
import { screen } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { userEvent } from "@testing-library/user-event";
import { Tooltip } from "../../../components/shared/Tooltip.tsx";
import { renderWithContexts } from "../../render.tsx";

View File

@@ -1,6 +1,6 @@
import { describe, expect, test, vi } from "vitest";
import { screen } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { userEvent } from "@testing-library/user-event";
import {
FollowPlaylistButton,
FollowUserButton,

View File

@@ -1,6 +1,6 @@
import { describe, expect, test, vi } from "vitest";
import { screen } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { userEvent } from "@testing-library/user-event";
import { LikeButton } from "../../../components/social/LikeButton.tsx";
import { route } from "../../fetch.ts";
import { page } from "../../fixtures.ts";

View File

@@ -1,6 +1,6 @@
import { describe, expect, test, vi } from "vitest";
import { act, screen } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { userEvent } from "@testing-library/user-event";
import { useRef } from "react";
import { UserListPopover } from "../../../components/social/UserListPopover.tsx";
import { calls, fail, route } from "../../fetch.ts";

View File

@@ -1,6 +1,6 @@
import { describe, expect, test, vi } from "vitest";
import { screen } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { userEvent } from "@testing-library/user-event";
import { VoteButton } from "../../../components/social/VoteButton.tsx";
import { route } from "../../fetch.ts";
import { makeUser, page } from "../../fixtures.ts";

View File

@@ -1,6 +1,6 @@
import { describe, expect, test, vi } from "vitest";
import { screen, waitFor, within } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { userEvent } from "@testing-library/user-event";
import { Route } from "react-router";
import { Dump } from "../../pages/Dump.tsx";
import { DumpEdit } from "../../pages/DumpEdit.tsx";

View File

@@ -1,6 +1,6 @@
import { describe, expect, test } from "vitest";
import { act, screen, waitFor, within } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { userEvent } from "@testing-library/user-event";
import { useParams } from "react-router";
import { Index } from "../../pages/Index.tsx";
import { calls, fail, route } from "../fetch.ts";

View File

@@ -1,6 +1,6 @@
import { describe, expect, test } from "vitest";
import { screen, waitFor } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { userEvent } from "@testing-library/user-event";
import { Notifications } from "../../pages/Notifications.tsx";
import type { Notification } from "../../model.ts";
import { calls, deferred, fail, route } from "../fetch.ts";

View File

@@ -6,7 +6,7 @@ import {
waitFor,
within,
} from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { userEvent } from "@testing-library/user-event";
import { Route } from "react-router";
import { PlaylistDetail } from "../../pages/PlaylistDetail.tsx";
import type { Dump, Playlist } from "../../model.ts";

View File

@@ -1,6 +1,6 @@
import { describe, expect, test } from "vitest";
import { screen } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { userEvent } from "@testing-library/user-event";
import { Route } from "react-router";
import { ResetPassword } from "../../pages/ResetPassword.tsx";
import { calls, fail, route } from "../fetch.ts";

View File

@@ -1,6 +1,6 @@
import { describe, expect, test } from "vitest";
import { act, screen } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { userEvent } from "@testing-library/user-event";
import { Search } from "../../pages/Search.tsx";
import { calls, fail, route } from "../fetch.ts";
import {

View File

@@ -1,6 +1,6 @@
import { describe, expect, test } from "vitest";
import { screen } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { userEvent } from "@testing-library/user-event";
import { UserDumps } from "../../pages/UserDumps.tsx";
import { fail, route } from "../fetch.ts";
import { makeDump, makeSession, makeUser, page, wire } from "../fixtures.ts";

View File

@@ -1,6 +1,6 @@
import { describe, expect, test } from "vitest";
import { screen } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { userEvent } from "@testing-library/user-event";
import { Route } from "react-router";
import { UserLogin } from "../../pages/UserLogin.tsx";
import { AUTH_STORAGE_KEY } from "../../utils/auth/storage.ts";

View File

@@ -1,6 +1,6 @@
import { describe, expect, test } from "vitest";
import { screen, within } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { userEvent } from "@testing-library/user-event";
import { UserPlaylists } from "../../pages/UserPlaylists.tsx";
import { calls, fail, route } from "../fetch.ts";
import {

View File

@@ -1,6 +1,6 @@
import { describe, expect, test, vi } from "vitest";
import { screen, waitFor, within } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { userEvent } from "@testing-library/user-event";
import { UserPublicProfile } from "../../pages/UserPublicProfile.tsx";
import type { PublicUser } from "../../model.ts";
import { calls, fail, route } from "../fetch.ts";

View File

@@ -1,6 +1,6 @@
import { describe, expect, test } from "vitest";
import { screen } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { userEvent } from "@testing-library/user-event";
import { Route } from "react-router";
import { UserRegister } from "../../pages/UserRegister.tsx";
import { calls, fail, route } from "../fetch.ts";

View File

@@ -1,6 +1,6 @@
import { describe, expect, test, vi } from "vitest";
import { act, screen, waitFor } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { userEvent } from "@testing-library/user-event";
import { UserUpvoted } from "../../pages/UserUpvoted.tsx";
import { route } from "../fetch.ts";
import { makeDump, makeSession, makeUser, page, wire } from "../fixtures.ts";