svg-layout-designer-react/src/utils/test-utils.tsx
Eric Nguyen ad126c6c28 Merged PR 170: Add new eslint rules
- naming-convention
- prefer-arrow-callback
- func-style
- import/no-default-export
2022-08-26 16:13:21 +00:00

21 lines
604 B
TypeScript

/* eslint-disable import/export */
import * as React from 'react';
import { cleanup, render, RenderResult } from '@testing-library/react';
import { afterEach } from 'vitest';
afterEach(() => {
cleanup();
});
function CustomRender(ui: React.ReactElement, options = {}): RenderResult {
return render(ui, {
// wrap provider(s) here if needed
wrapper: ({ children }) => children,
...options
});
}
export * from '@testing-library/react';
export { default as userEvent } from '@testing-library/user-event';
// override render export
export { CustomRender as render };