Skip to content

Commit

Permalink
updates code for fetch-mock 12
Browse files Browse the repository at this point in the history
  • Loading branch information
tsamaya committed Nov 8, 2024
1 parent 1e627ef commit 48d00ae
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/geosearch-core/test/OpenCageGeoSearchPlugin.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,15 @@ describe('geosearch-core:OpenCageGeoSearchPlugin', () => {
const url = `https://api.opencagedata.com/geosearch?q=${query}`;

beforeEach(() => {
fetchMock.mockGlobal();
fetchMock.get(url, payload);
});

afterEach(() => {
fetchMock.reset();
fetchMock.clearHistory();
fetchMock.unmockGlobal();
});

it('should return results with greno', async () => {
const plugin = theModule.OpenCageGeoSearchPlugin({
key: 'a real key',
Expand Down

0 comments on commit 48d00ae

Please sign in to comment.