Skip to content

Instantly share code, notes, and snippets.

@niemyjski
Created January 31, 2022 18:02
Show Gist options
  • Save niemyjski/9dbdd6afcc93f43f6198771ecdadeae2 to your computer and use it in GitHub Desktop.
Save niemyjski/9dbdd6afcc93f43f6198771ecdadeae2 to your computer and use it in GitHub Desktop.
React Exceptionless Jest Mock (Jest doesn't yet support esm modules).
import { ClassAttributes, HTMLAttributes } from "react";
jest.mock("@exceptionless/react", () => {
return {
__esModule: true,
Exceptionless: {
startup: jest.fn()
},
ExceptionlessErrorBoundary: (props: JSX.IntrinsicAttributes & ClassAttributes<HTMLDivElement> & HTMLAttributes<HTMLDivElement>) => {
return <div {...props} />;
}
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment