Skip to content

Commit

Permalink
Mock fetch in SenseEditor tests
Browse files Browse the repository at this point in the history
Signed-off-by: Miki <amoo_miki@yahoo.com>
  • Loading branch information
AMoo-Miki committed May 16, 2023
1 parent 424b032 commit 5dd356f
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,8 @@

import '../legacy_core_editor/legacy_core_editor.test.mocks';

import jQuery from 'jquery';
jest.spyOn(jQuery, 'ajax').mockImplementation(
() =>
new Promise(() => {
// never resolve
}) as any
global.fetch = jest.fn(() =>
Promise.resolve({
json: () => Promise.resolve({}),
})
);

0 comments on commit 5dd356f

Please sign in to comment.