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
@@ -48,21 +48,21 @@ describe('WorkflowCredentials', () => {
|
||||
jest.clearAllMocks();
|
||||
});
|
||||
|
||||
test('Should return an error if any node has no credential ID', () => {
|
||||
test('Should return an error if any node has no credential ID', async () => {
|
||||
const credentials = noIdNode.credentials!.test;
|
||||
const expectedError = new Error(
|
||||
`Credentials with name "${credentials.name}" for type "test" miss an ID.`,
|
||||
);
|
||||
expect(WorkflowCredentials([noIdNode])).rejects.toEqual(expectedError);
|
||||
await expect(WorkflowCredentials([noIdNode])).rejects.toEqual(expectedError);
|
||||
expect(mocked(Db.collections.Credentials.findOneBy)).toHaveBeenCalledTimes(0);
|
||||
});
|
||||
|
||||
test('Should return an error if credentials cannot be found in the DB', () => {
|
||||
test('Should return an error if credentials cannot be found in the DB', async () => {
|
||||
const credentials = notFoundNode.credentials!.test;
|
||||
const expectedError = new Error(
|
||||
`Could not find credentials for type "test" with ID "${credentials.id}".`,
|
||||
);
|
||||
expect(WorkflowCredentials([notFoundNode])).rejects.toEqual(expectedError);
|
||||
await expect(WorkflowCredentials([notFoundNode])).rejects.toEqual(expectedError);
|
||||
expect(mocked(Db.collections.Credentials.findOneBy)).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user