mirror of
https://github.com/strapi/strapi.git
synced 2025-09-27 09:25:46 +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 firstname = 'John';
|
||||||
const lastname = 'Doe';
|
const lastname = 'Doe';
|
||||||
|
|
||||||
const mockInquiry = jest.spyOn(inquirer, 'prompt').mockResolvedValue(async () => ({
|
const mockInquiry = jest.spyOn(inquirer, 'prompt').mockReturnValue({
|
||||||
email,
|
email,
|
||||||
password,
|
password,
|
||||||
firstname,
|
firstname,
|
||||||
lastname,
|
lastname,
|
||||||
confirm: true,
|
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(() => {});
|
const consoleError = jest.spyOn(console, 'error').mockImplementation(() => {});
|
||||||
|
|
||||||
await createAdminCommand().catch((err) => {
|
await createAdminCommand().catch((err) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user