From e76c7daa33a7665396679527bba7d0fdfeb2591d Mon Sep 17 00:00:00 2001 From: Maxim Mazurok Date: Fri, 16 Aug 2019 15:13:37 +0300 Subject: [PATCH] docs: update matchMedia methods (#8835) --- docs/ManualMocks.md | 7 +++++-- website/versioned_docs/version-23.x/ManualMocks.md | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/docs/ManualMocks.md b/docs/ManualMocks.md index f3da20638962..96e95a4e79da 100644 --- a/docs/ManualMocks.md +++ b/docs/ManualMocks.md @@ -146,8 +146,11 @@ window.matchMedia = jest.fn().mockImplementation(query => { matches: false, media: query, onchange: null, - addListener: jest.fn(), - removeListener: jest.fn(), + addListener: jest.fn(), // deprecated + removeListener: jest.fn(), // deprecated + addEventListener: jest.fn(), + removeEventListener: jest.fn(), + dispatchEvent: jest.fn(), }; }); ``` diff --git a/website/versioned_docs/version-23.x/ManualMocks.md b/website/versioned_docs/version-23.x/ManualMocks.md index 1dc9d0aaeda9..00c0495eeeaa 100644 --- a/website/versioned_docs/version-23.x/ManualMocks.md +++ b/website/versioned_docs/version-23.x/ManualMocks.md @@ -147,8 +147,11 @@ window.matchMedia = jest.fn().mockImplementation(query => { matches: false, media: query, onchange: null, - addListener: jest.fn(), - removeListener: jest.fn(), + addListener: jest.fn(), // deprecated + removeListener: jest.fn(), // deprecated + addEventListener: jest.fn(), + removeEventListener: jest.fn(), + dispatchEvent: jest.fn(), }; }); ```