Skip to content

Commit

Permalink
Creat new mock adapter for every test
Browse files Browse the repository at this point in the history
  • Loading branch information
bischofmax committed Jan 15, 2025
1 parent be02eb0 commit 956da35
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ jest.mock('jwks-rsa', () => () => {
describe('UserLoginMigrationController (API)', () => {
let app: INestApplication;
let em: EntityManager;
let axiosMock: MockAdapter;
let testApiClient: TestApiClient;
let configService: ConfigService;

Expand All @@ -56,7 +55,6 @@ describe('UserLoginMigrationController (API)', () => {
imports: [ServerTestModule],
}).compile();

axiosMock = new MockAdapter(axios);
app = moduleRef.createNestApplication();
await app.init();
em = app.get(EntityManager);
Expand Down Expand Up @@ -435,6 +433,8 @@ describe('UserLoginMigrationController (API)', () => {
targetUserId: string,
officialSchoolNumber: string
) => {
const axiosMock = new MockAdapter(axios);

axiosMock
.onPost(targetSystem.oauthConfig?.tokenEndpoint)
.replyOnce<OauthTokenResponse>(200, {
Expand Down

0 comments on commit 956da35

Please sign in to comment.