fix: Set '@typescript-eslint/return-await' rule to 'always' for node code (no-changelog) (#8363)
Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
This commit is contained in:
@@ -67,7 +67,7 @@ describe('External Secrets Manager', () => {
|
||||
mockProvidersInstance.setProviders({
|
||||
dummy: ErrorProvider,
|
||||
});
|
||||
expect(async () => manager!.init()).not.toThrow();
|
||||
expect(async () => await manager!.init()).not.toThrow();
|
||||
});
|
||||
|
||||
test('should not throw errors during shutdown', async () => {
|
||||
|
||||
@@ -5,7 +5,7 @@ import type { INodeTypeData } from 'n8n-workflow';
|
||||
* the macrotask queue and so called at the next iteration of the event loop
|
||||
* after all promises in the microtask queue have settled first.
|
||||
*/
|
||||
export const flushPromises = async () => new Promise(setImmediate);
|
||||
export const flushPromises = async () => await new Promise(setImmediate);
|
||||
|
||||
export function mockNodeTypesData(
|
||||
nodeNames: string[],
|
||||
|
||||
@@ -123,7 +123,7 @@ describe('check()', () => {
|
||||
],
|
||||
});
|
||||
|
||||
expect(async () => permissionChecker.check(workflow, userId)).not.toThrow();
|
||||
expect(async () => await permissionChecker.check(workflow, userId)).not.toThrow();
|
||||
});
|
||||
|
||||
test('should allow if requesting user is instance owner', async () => {
|
||||
@@ -153,7 +153,7 @@ describe('check()', () => {
|
||||
],
|
||||
});
|
||||
|
||||
expect(async () => permissionChecker.check(workflow, owner.id)).not.toThrow();
|
||||
expect(async () => await permissionChecker.check(workflow, owner.id)).not.toThrow();
|
||||
});
|
||||
|
||||
test('should allow if workflow creds are valid subset', async () => {
|
||||
@@ -200,7 +200,7 @@ describe('check()', () => {
|
||||
],
|
||||
});
|
||||
|
||||
expect(async () => permissionChecker.check(workflow, owner.id)).not.toThrow();
|
||||
expect(async () => await permissionChecker.check(workflow, owner.id)).not.toThrow();
|
||||
});
|
||||
|
||||
test('should deny if workflow creds are not valid subset', async () => {
|
||||
|
||||
@@ -22,7 +22,7 @@ describe('UserManagementMailer', () => {
|
||||
test('not be called when SMTP not set up', async () => {
|
||||
const userManagementMailer = new UserManagementMailer();
|
||||
// NodeMailer.verifyConnection gets called only explicitly
|
||||
await expect(async () => userManagementMailer.verifyConnection()).rejects.toThrow();
|
||||
await expect(async () => await userManagementMailer.verifyConnection()).rejects.toThrow();
|
||||
|
||||
expect(NodeMailer.prototype.verifyConnection).toHaveBeenCalledTimes(0);
|
||||
});
|
||||
@@ -34,7 +34,7 @@ describe('UserManagementMailer', () => {
|
||||
|
||||
const userManagementMailer = new UserManagementMailer();
|
||||
// NodeMailer.verifyConnection gets called only explicitly
|
||||
expect(async () => userManagementMailer.verifyConnection()).not.toThrow();
|
||||
expect(async () => await userManagementMailer.verifyConnection()).not.toThrow();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -173,7 +173,7 @@ describe('CommunityPackagesService', () => {
|
||||
|
||||
mocked(exec).mockImplementation(erroringExecMock);
|
||||
|
||||
const call = async () => communityPackagesService.executeNpmCommand('ls');
|
||||
const call = async () => await communityPackagesService.executeNpmCommand('ls');
|
||||
|
||||
await expect(call).rejects.toThrowError(RESPONSE_ERROR_MESSAGES.PACKAGE_NOT_FOUND);
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ describe('ShutdownService', () => {
|
||||
});
|
||||
|
||||
it('should throw error if app is not shutting down', async () => {
|
||||
await expect(async () => shutdownService.waitForShutdown()).rejects.toThrow(
|
||||
await expect(async () => await shutdownService.waitForShutdown()).rejects.toThrow(
|
||||
'App is not shutting down',
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user