mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-03-10 17:43:51 +00:00
Use external shlink-web-component and remove local one
This commit is contained in:
@@ -1,9 +1,6 @@
|
||||
import 'vitest-canvas-mock';
|
||||
import 'chart.js/auto';
|
||||
import type { TestingLibraryMatchers } from '@testing-library/jest-dom/matchers';
|
||||
import matchers from '@testing-library/jest-dom/matchers';
|
||||
import { cleanup } from '@testing-library/react';
|
||||
import ResizeObserver from 'resize-observer-polyfill';
|
||||
import { afterEach, expect } from 'vitest';
|
||||
|
||||
// Workaround for TypeScript error: https://github.com/testing-library/jest-dom/issues/439#issuecomment-1536524120
|
||||
@@ -14,15 +11,10 @@ declare module 'vitest' {
|
||||
// Extends Vitest's expect method with methods from react-testing-library
|
||||
expect.extend(matchers);
|
||||
|
||||
// Clear all mocks and cleanup DOM after every test
|
||||
afterEach(() => {
|
||||
// Clears all mocks after every test
|
||||
vi.clearAllMocks();
|
||||
// Run a cleanup after each test case (e.g. clearing jsdom)
|
||||
cleanup();
|
||||
});
|
||||
|
||||
(global as any).ResizeObserver = ResizeObserver;
|
||||
(global as any).scrollTo = () => {};
|
||||
(global as any).prompt = () => {};
|
||||
(global as any).matchMedia = (media: string) => ({ matches: false, media });
|
||||
(global as any).HTMLElement.prototype.scrollIntoView = () => {};
|
||||
|
||||
Reference in New Issue
Block a user