fix: failing tests
This commit is contained in:
1 parent
c115ac0749
commit
d70b14b12b
7 files changed
+320
-500
No files matched your search
@@ -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