2024-09-09 14:55:26 +02:00
|
|
|
import { expect } from "vitest"
|
2024-09-06 15:53:26 +02:00
|
|
|
import "@testing-library/jest-dom/vitest"
|
|
|
|
|
|
|
|
global.ResizeObserver = require("resize-observer-polyfill")
|
2023-04-18 15:37:29 +02:00
|
|
|
|
|
|
|
expect.extend({
|
|
|
|
toBeFunc: received => {
|
|
|
|
if (typeof received === "function") {
|
|
|
|
return {
|
|
|
|
pass: true,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return {
|
|
|
|
message: () => `expected ${received} to be a function`,
|
|
|
|
pass: false,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
toBe: (received, expected) => {
|
|
|
|
if (received === expected) {
|
|
|
|
return {
|
|
|
|
pass: true,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return {
|
|
|
|
message: () => `expected ${received} to be ${expected}`,
|
|
|
|
pass: false,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
})
|