fix: failing tests
This commit is contained in:
@@ -1,16 +1,17 @@
|
||||
// Try this import style instead
|
||||
import { expect, afterEach } from 'vitest';
|
||||
import { cleanup } from '@testing-library/react';
|
||||
import * as matchers from "@testing-library/jest-dom/matchers";
|
||||
import * as matchers from '@testing-library/jest-dom/matchers';
|
||||
|
||||
class ResizeObserver {
|
||||
// Add the matchers (should work with * as import)
|
||||
expect.extend(matchers);
|
||||
|
||||
// Mock ResizeObserver
|
||||
global.ResizeObserver = class {
|
||||
observe() { }
|
||||
unobserve() { }
|
||||
disconnect() { }
|
||||
}
|
||||
|
||||
globalThis.ResizeObserver = ResizeObserver;
|
||||
|
||||
expect.extend(matchers);
|
||||
};
|
||||
|
||||
afterEach(() => {
|
||||
cleanup();
|
||||
|
||||
Reference in New Issue
Block a user