mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
refactor: Async functions don't need to explicitly return promises (no-changelog) (#6041)
This commit is contained in:
committed by
GitHub
parent
03be725cef
commit
308a94311f
@@ -29,7 +29,7 @@ const fakeConnection = {
|
||||
format(query: string, values: any[]) {
|
||||
return mysql2.format(query, values);
|
||||
},
|
||||
query: jest.fn(async (_query = ''): Promise<any> => Promise.resolve([{}])),
|
||||
query: jest.fn(async (_query = '') => [{}]),
|
||||
release: jest.fn(),
|
||||
beginTransaction: jest.fn(),
|
||||
commit: jest.fn(),
|
||||
@@ -41,7 +41,7 @@ const createFakePool = (connection: IDataObject) => {
|
||||
getConnection() {
|
||||
return connection;
|
||||
},
|
||||
query: jest.fn(async () => Promise.resolve([{}])),
|
||||
query: jest.fn(async () => [{}]),
|
||||
} as unknown as Mysql2Pool;
|
||||
};
|
||||
|
||||
@@ -214,7 +214,7 @@ describe('Test MySql V2, operations', () => {
|
||||
} else {
|
||||
result.push({});
|
||||
}
|
||||
return Promise.resolve(result);
|
||||
return result;
|
||||
});
|
||||
const pool = createFakePool(fakeConnectionCopy);
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ const fakeConnection = {
|
||||
format(query: string, values: any[]) {
|
||||
return mysql2.format(query, values);
|
||||
},
|
||||
query: jest.fn(async () => Promise.resolve([{}])),
|
||||
query: jest.fn(async () => [{}]),
|
||||
release: jest.fn(),
|
||||
beginTransaction: jest.fn(),
|
||||
commit: jest.fn(),
|
||||
@@ -35,7 +35,7 @@ const createFakePool = (connection: IDataObject) => {
|
||||
getConnection() {
|
||||
return connection;
|
||||
},
|
||||
query: jest.fn(async () => Promise.resolve([{}])),
|
||||
query: jest.fn(async () => [{}]),
|
||||
} as unknown as Mysql2Pool;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user