mirror of
https://git.um-react.app/um/um-react.git
synced 2025-11-28 03:23:02 +00:00
chore: make eslint happy
This commit is contained in:
@@ -3,10 +3,11 @@ import '@testing-library/jest-dom';
|
||||
// FIXME: Use something like jsdom-worker?
|
||||
// see: https://github.com/developit/jsdom-worker
|
||||
if (!global.Worker) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
(global as any).Worker = class MockWorker {
|
||||
events: Record<string, (e: unknown) => void> = Object.create(null);
|
||||
|
||||
onmessage?: () => {};
|
||||
onmessage = undefined;
|
||||
addEventListener(name: string, e: unknown) {
|
||||
if (Object.hasOwn(this.events, name)) {
|
||||
this.events[name](e);
|
||||
|
||||
@@ -6,6 +6,7 @@ import { AppStore, RootState, setupStore } from '~/store';
|
||||
|
||||
// Adapted from: https://redux.js.org/usage/writing-tests
|
||||
|
||||
// eslint-disable-next-line react-refresh/only-export-components
|
||||
export * from '@testing-library/react';
|
||||
|
||||
export interface ExtendedRenderOptions extends RenderOptions {
|
||||
@@ -17,7 +18,7 @@ export function renderWithProviders(
|
||||
ui: React.ReactElement,
|
||||
{ preloadedState = {}, store = setupStore(preloadedState), ...renderOptions }: ExtendedRenderOptions = {}
|
||||
) {
|
||||
function Wrapper({ children }: PropsWithChildren<{}>): JSX.Element {
|
||||
function Wrapper({ children }: PropsWithChildren<unknown>): JSX.Element {
|
||||
return <Provider store={store}>{children}</Provider>;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user