mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +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
@@ -40,7 +40,7 @@ describe('OwnerController', () => {
|
||||
describe('preSetup', () => {
|
||||
it('should throw a BadRequestError if the instance owner is already setup', async () => {
|
||||
config.getEnv.calledWith('userManagement.isInstanceOwnerSetUp').mockReturnValue(true);
|
||||
expect(controller.preSetup()).rejects.toThrowError(
|
||||
await expect(controller.preSetup()).rejects.toThrowError(
|
||||
new BadRequestError('Instance owner already setup'),
|
||||
);
|
||||
});
|
||||
@@ -58,7 +58,7 @@ describe('OwnerController', () => {
|
||||
describe('setupOwner', () => {
|
||||
it('should throw a BadRequestError if the instance owner is already setup', async () => {
|
||||
config.getEnv.calledWith('userManagement.isInstanceOwnerSetUp').mockReturnValue(true);
|
||||
expect(controller.setupOwner(mock(), mock())).rejects.toThrowError(
|
||||
await expect(controller.setupOwner(mock(), mock())).rejects.toThrowError(
|
||||
new BadRequestError('Instance owner already setup'),
|
||||
);
|
||||
});
|
||||
@@ -66,7 +66,7 @@ describe('OwnerController', () => {
|
||||
it('should throw a BadRequestError if the email is invalid', async () => {
|
||||
config.getEnv.calledWith('userManagement.isInstanceOwnerSetUp').mockReturnValue(false);
|
||||
const req = mock<OwnerRequest.Post>({ body: { email: 'invalid email' } });
|
||||
expect(controller.setupOwner(req, mock())).rejects.toThrowError(
|
||||
await expect(controller.setupOwner(req, mock())).rejects.toThrowError(
|
||||
new BadRequestError('Invalid email address'),
|
||||
);
|
||||
});
|
||||
@@ -76,7 +76,7 @@ describe('OwnerController', () => {
|
||||
it(password, async () => {
|
||||
config.getEnv.calledWith('userManagement.isInstanceOwnerSetUp').mockReturnValue(false);
|
||||
const req = mock<OwnerRequest.Post>({ body: { email: 'valid@email.com', password } });
|
||||
expect(controller.setupOwner(req, mock())).rejects.toThrowError(
|
||||
await expect(controller.setupOwner(req, mock())).rejects.toThrowError(
|
||||
new BadRequestError(errorMessage),
|
||||
);
|
||||
});
|
||||
@@ -88,7 +88,7 @@ describe('OwnerController', () => {
|
||||
const req = mock<OwnerRequest.Post>({
|
||||
body: { email: 'valid@email.com', password: 'NewPassword123', firstName: '', lastName: '' },
|
||||
});
|
||||
expect(controller.setupOwner(req, mock())).rejects.toThrowError(
|
||||
await expect(controller.setupOwner(req, mock())).rejects.toThrowError(
|
||||
new BadRequestError('First and last names are mandatory'),
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user