feat(core): Remove all floating promises. Enforce @typescript-eslint/no-floating-promises (#6281)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2023-05-24 00:01:45 +00:00
committed by GitHub
parent 5d2f4746ea
commit e046f656fe
33 changed files with 94 additions and 120 deletions

View File

@@ -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);
});