From 26b3cd733412ce2d9df37a42204ce7242c4d9647 Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Fri, 8 Aug 2025 23:43:04 +0100 Subject: Mock react-markdown to fix jest issue --- jest.config.js | 1 + src/__mocks__/react-markdown.tsx | 12 ++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 src/__mocks__/react-markdown.tsx diff --git a/jest.config.js b/jest.config.js index daadd49..e14046b 100644 --- a/jest.config.js +++ b/jest.config.js @@ -4,6 +4,7 @@ module.exports = { }, moduleNameMapper: { '\\.svg$': '/src/tests/__mocks__/svg.ts', + "^react-markdown$": "/src/__mocks__/react-markdown.tsx", }, collectCoverageFrom: [ "src/**/*.{js,jsx,ts,tsx}", diff --git a/src/__mocks__/react-markdown.tsx b/src/__mocks__/react-markdown.tsx new file mode 100644 index 0000000..678cf61 --- /dev/null +++ b/src/__mocks__/react-markdown.tsx @@ -0,0 +1,12 @@ +import React from 'react'; + +interface ReactMarkdownProps { + children: string; + [key: string]: any; +} + +const ReactMarkdown: React.FC = ({ children }) => { + return
{children}
; +}; + +export default ReactMarkdown; -- cgit v1.2.3