From 8a29943c4dca22c2a905a5c97be65c392f2b7ffc Mon Sep 17 00:00:00 2001 From: Gao Sun Date: Sun, 28 Jul 2024 11:59:25 +0800 Subject: [PATCH] chore: fix failed tests --- packages/integration-tests/jest.setup.api.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/integration-tests/jest.setup.api.js b/packages/integration-tests/jest.setup.api.js index d31c2670d..192d1146e 100644 --- a/packages/integration-tests/jest.setup.api.js +++ b/packages/integration-tests/jest.setup.api.js @@ -1,5 +1,11 @@ +import { createRequire } from 'node:module'; + import { authedAdminTenantApi } from './lib/api/api.js'; +// A patch for the global require function - see https://github.com/evanw/esbuild/issues/1921 +// eslint-disable-next-line @silverhand/fp/no-mutation +globalThis.require = createRequire(import.meta.url); + // We need to update this before tests otherwise Logto will update SignInMode for admin tenant // The update logic should be await authedAdminTenantApi.patch('sign-in-exp', {