mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-20 03:12:15 +00:00
ci: Fix code coverage for nodes-base (no-changelog) (#14319)
This commit is contained in:
committed by
GitHub
parent
a245a5ca61
commit
a31a55440a
@@ -6,8 +6,15 @@ import type {
|
||||
IVersionedNodeType,
|
||||
KnownNodesAndCredentials,
|
||||
LoadedClass,
|
||||
LoadingDetails,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
/** This rewrites the nodes/credentials source path to load the typescript code instead of the compiled javascript code */
|
||||
const fixSourcePath = (loadInfo: LoadingDetails) => {
|
||||
if (!loadInfo) return;
|
||||
loadInfo.sourcePath = loadInfo.sourcePath.replace(/^dist\//, './').replace(/\.js$/, '.ts');
|
||||
};
|
||||
|
||||
@Service()
|
||||
export class LoadNodesAndCredentials {
|
||||
private loader: LazyPackageDirectoryLoader;
|
||||
@@ -29,11 +36,13 @@ export class LoadNodesAndCredentials {
|
||||
}
|
||||
|
||||
getCredential(credentialType: string): LoadedClass<ICredentialType> {
|
||||
fixSourcePath(this.known.credentials[credentialType]);
|
||||
return this.loader.getCredential(credentialType);
|
||||
}
|
||||
|
||||
getNode(fullNodeType: string): LoadedClass<INodeType | IVersionedNodeType> {
|
||||
const nodeType = fullNodeType.split('.')[1];
|
||||
fixSourcePath(this.known.nodes[nodeType]);
|
||||
return this.loader.getNode(nodeType);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user