catalog-backend-module-github: work around lack of msw fetch support in Node 18

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2022-09-22 17:44:51 +02:00
parent 21339ea595
commit 90e5b42258
@@ -25,6 +25,11 @@ import {
getOrganizationRepositories,
QueryResponse,
} from './github';
import fetch from 'node-fetch';
// Workaround for Node.js 18, where native fetch is available, but not yet picked up by msw
// TODO(Rugvip): remove once https://github.com/mswjs/msw/issues/1388 is resolved
(global as any).fetch = fetch;
describe('github', () => {
const server = setupServer();