0493fcc939
Initialize AddEventModal state from editEvent props directly, removing the useEffect that synchronized state. Add AbortController to useRouteQuery to cancel in-flight requests when dependencies change or component unmounts. Add @testing-library/user-event and fix related tests to handle async user events. Polyfill localStorage in Vitest setup for jsdom environment.
25 lines
446 B
TypeScript
25 lines
446 B
TypeScript
import type {} from "vitest/config";
|
|
import react from "@vitejs/plugin-react";
|
|
import path from "path";
|
|
|
|
const config = {
|
|
plugins: [react()],
|
|
test: {
|
|
environment: "jsdom",
|
|
environmentOptions: {
|
|
jsdom: {
|
|
url: "http://localhost/",
|
|
},
|
|
},
|
|
globals: true,
|
|
setupFiles: ["./src/test/setup.ts"],
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
"@": path.resolve(__dirname, "./src"),
|
|
},
|
|
},
|
|
};
|
|
|
|
export default config;
|