diff --git a/packages/core/strapi/src/commands/actions/admin/create-user/__tests__/admin.create-user.test.ts b/packages/core/strapi/src/commands/actions/admin/create-user/__tests__/admin.create-user.test.ts index 297fabc0ed..8c3b11fcec 100644 --- a/packages/core/strapi/src/commands/actions/admin/create-user/__tests__/admin.create-user.test.ts +++ b/packages/core/strapi/src/commands/actions/admin/create-user/__tests__/admin.create-user.test.ts @@ -319,15 +319,17 @@ describe('admin:create command', () => { const firstname = 'John'; const lastname = 'Doe'; - const mockInquiry = jest.spyOn(inquirer, 'prompt').mockResolvedValue(async () => ({ + const mockInquiry = jest.spyOn(inquirer, 'prompt').mockReturnValue({ email, password, firstname, lastname, confirm: true, - })); + } as any); - const mockExit = jest.spyOn(process, 'exit').mockImplementation(() => undefined as never); + const mockExit = jest.spyOn(process, 'exit').mockImplementation(() => { + throw new Error('exit'); + }); const consoleError = jest.spyOn(console, 'error').mockImplementation(() => {}); await createAdminCommand().catch((err) => {