From ed9bc6e9147a5901da572ed16c9069e74462198c Mon Sep 17 00:00:00 2001 From: Marek Mihok Date: Thu, 16 Nov 2023 10:53:59 +0100 Subject: [PATCH] chore: move mock to setupTests.ts #2179 --- ui/jest.config.js | 2 -- ui/src/setupTests.ts | 2 ++ ui/src/styleMock.js | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) delete mode 100644 ui/src/styleMock.js diff --git a/ui/jest.config.js b/ui/jest.config.js index d460bb6387..002e840936 100644 --- a/ui/jest.config.js +++ b/ui/jest.config.js @@ -19,13 +19,11 @@ module.exports = { testEnvironment: "jsdom", transformIgnorePatterns: [ "[/\\\\]node_modules[/\\\\].+\\.(js|jsx|ts|tsx)$", - // "^.+\\.module\\.(css|sass|scss)$" ], modulePaths: [], moduleNameMapper: { "^react-native$": "react-native-web", '^d3$': '/node_modules/d3/dist/d3.min.js', - '\\.(css)$': '/src/styleMock.js' }, moduleFileExtensions: [ "web.js", diff --git a/ui/src/setupTests.ts b/ui/src/setupTests.ts index c456897531..8c038258a7 100644 --- a/ui/src/setupTests.ts +++ b/ui/src/setupTests.ts @@ -29,6 +29,8 @@ jest.mock('d3', () => ({ pie: () => ({ value: () => () => [] }), })) jest.mock('d3-interpolate', () => ({ extent: () => '' })) +jest.mock('./markdown.css', () => '') + const icons = Object.entries(Icons).reduce((acc, [iconName, iconComponent]) => { if ('displayName' in iconComponent) acc[iconName.slice(0, -4)] = React.createElement(iconComponent as React.FC) diff --git a/ui/src/styleMock.js b/ui/src/styleMock.js deleted file mode 100644 index a099545376..0000000000 --- a/ui/src/styleMock.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = {}; \ No newline at end of file