From cf38066e613f4d1ee6b35585115c752634ad56fc Mon Sep 17 00:00:00 2001 From: Simon Podlipsky Date: Mon, 19 May 2025 18:09:15 +0200 Subject: [PATCH] chore(jest): make setup up to date --- .config/jest-setup.js | 6 +++--- .config/jest.config.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.config/jest-setup.js b/.config/jest-setup.js index b9f57384..74832e34 100644 --- a/.config/jest-setup.js +++ b/.config/jest-setup.js @@ -2,7 +2,7 @@ * ⚠️⚠️⚠️ THIS FILE WAS SCAFFOLDED BY `@grafana/create-plugin`. DO NOT EDIT THIS FILE DIRECTLY. ⚠️⚠️⚠️ * * In order to extend the configuration follow the steps in - * https://grafana.com/developers/plugin-tools/create-a-plugin/extend-a-plugin/extend-configurations#extend-the-jest-config + * https://grafana.com/developers/plugin-tools/get-started/set-up-development-environment#extend-the-jest-config */ import '@testing-library/jest-dom'; @@ -13,7 +13,7 @@ Object.assign(global, { TextDecoder, TextEncoder }); // https://jestjs.io/docs/manual-mocks#mocking-methods-which-are-not-implemented-in-jsdom Object.defineProperty(global, 'matchMedia', { writable: true, - value: jest.fn().mockImplementation((query) => ({ + value: (query) => ({ matches: false, media: query, onchange: null, @@ -22,7 +22,7 @@ Object.defineProperty(global, 'matchMedia', { addEventListener: jest.fn(), removeEventListener: jest.fn(), dispatchEvent: jest.fn(), - })), + }), }); HTMLCanvasElement.prototype.getContext = () => {}; diff --git a/.config/jest.config.js b/.config/jest.config.js index 94489cb2..09704b4f 100644 --- a/.config/jest.config.js +++ b/.config/jest.config.js @@ -2,7 +2,7 @@ * ⚠️⚠️⚠️ THIS FILE WAS SCAFFOLDED BY `@grafana/create-plugin`. DO NOT EDIT THIS FILE DIRECTLY. ⚠️⚠️⚠️ * * In order to extend the configuration follow the steps in - * https://grafana.com/developers/plugin-tools/create-a-plugin/extend-a-plugin/extend-configurations#extend-the-jest-config + * https://grafana.com/developers/plugin-tools/get-started/set-up-development-environment#extend-the-jest-config */ const path = require('path');