Skip to content

Commit

Permalink
move credentials tests before node tests
Browse files Browse the repository at this point in the history
  • Loading branch information
netroy committed Nov 29, 2022
1 parent a25cd6f commit f24f2c2
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions packages/cli/src/CredentialsHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,14 @@ export class CredentialsHelper extends ICredentialsHelper {
private getCredentialTestFunction(
credentialType: string,
): ICredentialTestFunction | ICredentialTestRequestData | undefined {
// Check if test is defined on credentials
const type = this.credentialTypes.getByName(credentialType);
if (type.test) {
return {
testRequest: type.test,
};
}

const nodeTypesToTestWith = this.credentialTypes.getNodeTypesToTestWith(credentialType);
for (const nodeName of nodeTypesToTestWith) {
const node = this.nodeTypes.getByName(nodeName);
Expand Down Expand Up @@ -515,14 +523,6 @@ export class CredentialsHelper extends ICredentialsHelper {
}
}

// Check if test is defined on credentials
const type = this.credentialTypes.getByName(credentialType);
if (type.test) {
return {
testRequest: type.test,
};
}

return undefined;
}

Expand Down

0 comments on commit f24f2c2

Please sign in to comment.