use node-fetch

Signed-off-by: Katharina Sick <katharina.sick@dynatrace.com>
This commit is contained in:
Katharina Sick
2023-02-13 16:31:49 +01:00
parent 0c1d0229aa
commit 1fad33684e
4 changed files with 46 additions and 10 deletions
@@ -26,8 +26,6 @@ import { setupServer } from 'msw/node';
import { setupRequestMockHandlers } from '@backstage/test-utils';
import { rest } from 'msw';
global.fetch = require('node-fetch');
jest.mock('../../lib/passport/PassportStrategyHelper', () => {
return {
...jest.requireActual('../../lib/passport/PassportStrategyHelper'),
@@ -42,6 +42,7 @@ import express from 'express';
import { createAuthProviderIntegration } from '../createAuthProviderIntegration';
import { Profile as PassportProfile } from 'passport';
import { commonByEmailResolver } from '../resolvers';
import fetch from 'node-fetch';
type PrivateInfo = {
refreshToken: string;
@@ -215,7 +216,7 @@ export class BitbucketServerAuthProvider implements OAuthHandlers {
throw new Error(`Failed to retrieve the user '${username}'`);
}
const user = await userResponse.json();
const user = (await userResponse.json()) as any;
const passportProfile = {
provider: 'bitbucketServer',