mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
feat(core): Remove all floating promises. Enforce @typescript-eslint/no-floating-promises (#6281)
This commit is contained in:
committed by
GitHub
parent
5d2f4746ea
commit
e046f656fe
@@ -26,14 +26,14 @@ describe('MeController', () => {
|
||||
describe('updateCurrentUser', () => {
|
||||
it('should throw BadRequestError if email is missing in the payload', async () => {
|
||||
const req = mock<MeRequest.UserUpdate>({});
|
||||
expect(controller.updateCurrentUser(req, mock())).rejects.toThrowError(
|
||||
await expect(controller.updateCurrentUser(req, mock())).rejects.toThrowError(
|
||||
new BadRequestError('Email is mandatory'),
|
||||
);
|
||||
});
|
||||
|
||||
it('should throw BadRequestError if email is invalid', async () => {
|
||||
const req = mock<MeRequest.UserUpdate>({ body: { email: 'invalid-email' } });
|
||||
expect(controller.updateCurrentUser(req, mock())).rejects.toThrowError(
|
||||
await expect(controller.updateCurrentUser(req, mock())).rejects.toThrowError(
|
||||
new BadRequestError('Invalid email address'),
|
||||
);
|
||||
});
|
||||
@@ -103,7 +103,7 @@ describe('MeController', () => {
|
||||
user: mock({ password: undefined }),
|
||||
body: { currentPassword: '', newPassword: '' },
|
||||
});
|
||||
expect(controller.updatePassword(req, mock())).rejects.toThrowError(
|
||||
await expect(controller.updatePassword(req, mock())).rejects.toThrowError(
|
||||
new BadRequestError('Requesting user not set up.'),
|
||||
);
|
||||
});
|
||||
@@ -113,7 +113,7 @@ describe('MeController', () => {
|
||||
user: mock({ password: passwordHash }),
|
||||
body: { currentPassword: 'not_old_password', newPassword: '' },
|
||||
});
|
||||
expect(controller.updatePassword(req, mock())).rejects.toThrowError(
|
||||
await expect(controller.updatePassword(req, mock())).rejects.toThrowError(
|
||||
new BadRequestError('Provided current password is incorrect.'),
|
||||
);
|
||||
});
|
||||
@@ -125,7 +125,7 @@ describe('MeController', () => {
|
||||
user: mock({ password: passwordHash }),
|
||||
body: { currentPassword: 'old_password', newPassword },
|
||||
});
|
||||
expect(controller.updatePassword(req, mock())).rejects.toThrowError(
|
||||
await expect(controller.updatePassword(req, mock())).rejects.toThrowError(
|
||||
new BadRequestError(errorMessage),
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user