- Fix router import path in main.js - Handle Django REST Framework pagination format in API calls - Add getTemplates function to project API - Restart frontend development server
25 lines
573 B
TypeScript
25 lines
573 B
TypeScript
import './vitest.extend';
|
|
import { getEnv, setEnv } from './src/env';
|
|
import { beforeAll } from 'vitest';
|
|
import { isJSDOM } from './vitest.extend';
|
|
|
|
// set custom env
|
|
beforeAll(() => {
|
|
if (isJSDOM()) {
|
|
setEnv({ ...getEnv(), window, document });
|
|
}
|
|
|
|
// Polyfill for jsdom
|
|
if (typeof globalThis.Touch === 'undefined') {
|
|
globalThis.Touch = class Touch {
|
|
clientX: number;
|
|
clientY: number;
|
|
identifier: number;
|
|
target: EventTarget;
|
|
constructor(init: Partial<Touch>) {
|
|
Object.assign(this, init);
|
|
}
|
|
} as any;
|
|
}
|
|
});
|