mirror of
https://github.com/strapi/strapi.git
synced 2025-09-25 16:29:34 +00:00
Refactor testing to work with ts
This commit is contained in:
parent
2ba8f776a0
commit
be93bda38a
@ -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) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user